我正在尝试让密码重置工作。我用了这个教程
Django 版本 1.5.1
当我输入电子邮件地址并点击“重置密码”按钮时,我收到一条错误消息:
Exception Type: NoReverseMatch
Exception Value: Reverse for 'django.contrib.auth.views.password_reset_confirm' with arguments '()' and keyword arguments '{u'uidb36': u'q', u'token': u'3ky-999ef6e52ef0743cdb2a'}' not found.
原因似乎是:
{{ protocol }}://{{ domain }}{% url 'django.contrib.auth.views.password_reset_confirm' uidb36=uid token=token %}
我的 urls.py:
url(r'^user/password/reset/$', 'django.contrib.auth.views.password_reset', {'post_reset_redirect' : 'user/password/reset/done/','template_name': 'main/registration/password_reset_form.html'}, name="password_reset"),
url(r'^user/password/reset/done/$', 'django.contrib.auth.views.password_reset_done', {'template_name': 'main/registration/password_reset_done.html'}),
url(r'^user/password/reset/(?P<uidb36>[0-9A-Za-z]+)/(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm', {'template_name': 'main/registration/password_reset_confirm.html', 'post_reset_redirect' : 'user/password/done/'}),
url(r'^user/password/done/$', 'django.contrib.auth.views.password_reset_complete',{'template_name': 'main/registration/password_reset_complete.html'})
我现在正在尝试几个小时,也许有人可以给我一个提示。提前谢谢了。