问题
url(r'^register/$',
RegistrationView.as_view(form_class=CustomRegistrationForm,
success_url='/profile'),
name='registration_register',
success_url='/profile'),
I have the following in my urls.py.
How do I redirect people after they register using django registration 1.0?
回答1:
The redirect will be issued to the path specified by RegistrationView.get_success_url, which should be RegistrationView.success_url which you've specified when constructing the view function.
You can review RequestView.form_valid for more details.
来源:https://stackoverflow.com/questions/18901724/how-to-redirect-people-after-they-register-using-django-registration