How to use different form in Django-Registration

Viewed 6516

Django-Registration has several form classes in the forms.py file. One is "class RegistrationFormTermsOfService(RegistrationForm) ..

What do I change in the rest of Django Registration code to enable this form in my registration flow instead of RegistrationForm?

5 Answers

As to django 1.11 and django-registration 2.2 there are some updated imports... so if you get "No module named 'registration'" this could be the problem... Replace:

  • from registration.backends.hmac.views import RegistrationView by from django_registration.backends.activation.views import RegistrationView

  • from registration.forms import RegistrationForm by from django_registration.forms import RegistrationForm

  • include('django_registration.backends.hmac.urls') in urls by include('django_registration.backends.activation.urls')

Just to name a few... ;)

Src: https://django-registration.readthedocs.io/en/3.0/custom-user.html

Related