Django reset_password_confirm TemplateSyntaxError problem

后端 未结 8 1362
夕颜
夕颜 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

    If you're using Django 1.6+ and run into something like this it could be that you need to update uidb36 to uidb64 in both your template and your urls.

    Example url: url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', auth_views.password_reset_confirm

    and reset link in template:

    {{ protocol}}://{{ domain }}{% url 'django.contrib.auth.views.password_reset_confirm' uidb64=uid token=token %}

    0 讨论(0)
  • 2020-12-13 21:26

    Try adding following to your urls.py

    (r'^reset/(?P<uidb36>[0-9A-Za-z]{1,13})-(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm'),
    
    0 讨论(0)
提交回复
热议问题