How to use different form in Django-Registration

后端 未结 5 1534
小蘑菇
小蘑菇 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条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-15 16:18

    You can simply go into your urls.py and override the form class by doing something like:

    from registration.forms import RegistrationFormTermsOfService
    
    (r'^accounts/register/$', 'registration.views.register', {'form_class' : RegistrationFormTermsOfService}),
    

提交回复
热议问题