Django reset_password_confirm TemplateSyntaxError problem

后端 未结 8 1377
夕颜
夕颜 2020-12-13 20:39

when I use django.contrib.auth.views.password_reset_confirm without arguments at all it works and I can render the template without any problem, when adding

8条回答
  •  既然无缘
    2020-12-13 21:21

    Most likely it is an issue with your urls.py. You need to setup the right pattern to grab the uidb36 and token values passed as URL parameters. If not, it will throw a similar error to what you see above.

    Something like:

    (r'^reset/(?P[0-9A-Za-z]+)-(?P.+)/$', 'django.contrib.auth.views.password_reset_confirm', {'template_name' : 'registration/password_reset.html',  'post_reset_redirect': '/logout/' })
    

    registration/password_reset.html - is my custom template

    logout - is my custom logout action

提交回复
热议问题