How to redirect people after they register using django registration

ⅰ亾dé卋堺 提交于 2019-12-11 02:59:44

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!