Django reset_password_confirm TemplateSyntaxError problem

后端 未结 8 1393
夕颜
夕颜 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:12

    For Django 1.8+ users, just copy this URL to your main urls.py file, so that it recognizes the URL name

      url(r'^reset/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
            'django.contrib.auth.views.password_reset_confirm',
            name='password_reset_confirm'),
    

    And add this mentioned by: @Lunulata to your password_reset_email.html file:

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

提交回复
热议问题