Django:Password_reset_complete 错误
Django: Password_reset_complete error
我正在使用 django v1.8
在urls.py
我有
url(r'^user/password/reset/$', 'django.contrib.auth.views.password_reset', {'post_reset_redirect' : '/user/password/reset/done/'}, name="password_reset"),
url(r'^user/password/reset/done/$', 'django.contrib.auth.views.password_reset_done'),
url(r'^user/password/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm', name='password_reset_confirm'),
url(r'^user/password/done/$', 'django.contrib.auth.views.password_reset_complete'),
我给了我的电子邮件 我知道了 link:
http://127.0.0.1:8000/user/password/reset/NA/4c7-8abfc6c9f90cadf94c0f/
当我试图达到这个 link 我得到 NoReverseMatch at /reset/NA/4c7-8abfc6c9f90cadf94c0f/
Reverse for 'password_reset_complete' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
你知道如何解决这个问题吗?
您需要从
更正您的 urls.py
url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+) ......
至
url(r'^user/password/reset/(?P<uidb64>[0-9A-Za-z_\-]+) ......
而不是在 urls.py
中设置不同的 url 我只设置了一个。
url(r'^accounts/', include('django.contrib.auth.urls')),
有了这个,我就可以在浏览器中使用这个 APIs:
accounts/login/
accounts/logout/
accounts/password_change/
accounts/password_reset/
我正在使用 django v1.8
在urls.py
我有
url(r'^user/password/reset/$', 'django.contrib.auth.views.password_reset', {'post_reset_redirect' : '/user/password/reset/done/'}, name="password_reset"),
url(r'^user/password/reset/done/$', 'django.contrib.auth.views.password_reset_done'),
url(r'^user/password/reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', 'django.contrib.auth.views.password_reset_confirm', name='password_reset_confirm'),
url(r'^user/password/done/$', 'django.contrib.auth.views.password_reset_complete'),
我给了我的电子邮件 我知道了 link:
http://127.0.0.1:8000/user/password/reset/NA/4c7-8abfc6c9f90cadf94c0f/
当我试图达到这个 link 我得到 NoReverseMatch at /reset/NA/4c7-8abfc6c9f90cadf94c0f/
Reverse for 'password_reset_complete' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
你知道如何解决这个问题吗?
您需要从
更正您的urls.py
url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+) ......
至
url(r'^user/password/reset/(?P<uidb64>[0-9A-Za-z_\-]+) ......
而不是在 urls.py
中设置不同的 url 我只设置了一个。
url(r'^accounts/', include('django.contrib.auth.urls')),
有了这个,我就可以在浏览器中使用这个 APIs:
accounts/login/
accounts/logout/
accounts/password_change/
accounts/password_reset/