How to use different form in Django-Registration

后端 未结 5 1530
小蘑菇
小蘑菇 2021-02-15 15:39

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

What do I change in the rest of Dja

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-15 16:26

    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

提交回复
热议问题