3
votes

Good evening, I am using django-registration for a Web application; By using this, the form that has default django-registration only has 4 fields (username, email, password, repeat password). How to add more fields to this form and store them in the database correctly? Thank you.

1

1 Answers

0
votes

I haven't used django-registrations but I found a link which might be helpful to you.

All you need to do is extend the class 'RegistrationForm' and add more fields.

Something like this: forms.py

import from registration.forms import RegistrationForm

class CustomRegistrationForm(RegistrationForm):
   extra_field = forms.EmailField()
   extra_field_2 ...

Then, handle the form POST and save these details.

http://django-registration.readthedocs.io/en/2.0.1/forms.html