[英]path is deprecated (django.contrib.auth.views.password_reset_confirm)
I am working on password reset on django project, when the email address is sent i get 我正在django项目上重置密码,当发送电子邮件地址时我得到
path is deprecated (django.contrib.auth.views.password_reset_confirm)
at the command prompt. 在命令提示符下。
Here is my url.py 这是我的url.py
from django.conf.urls import patterns, include, url
from django.contrib import admin
from doreenselly import views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.views import password_reset, password_reset_done, password_reset_confirm, password_reset_complete
from django.views.generic import TemplateView
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', 'selly.views.index', name="index"),
url(r'^selly/', include('selly.urls')),
url(r'^delete_item/(?P<item_id>[-\w]+)/$', views.delete_item, name='delete_item'),
url(r'^admin_delete_item/(?P<item_id>[-\w]+)/$', views.admin_delete_item, name='admin_delete_item'),
# Password reset urls
url(r'^reset/form/$', TemplateView.as_view(template_name = 'registration/password_reset_email.html')),
url(r'^resetpassword/passwordsent/$', password_reset_done, name="password_reset_done"),
url(r'^reset/password/$', password_reset, name="password_reset"),
url(r'^reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', password_reset_confirm, name="password_reset_confirm"),
url(r'^reset/done/$', password_reset_complete, name="password_reset_complete"),
]
Your urls look OK, so my guess is the problem is in your template. 您的网址看起来不错,所以我想问题出在您的模板中。
Look for 寻找
{% url 'django.contrib.auth.views.password_reset_confirm' uidb64=uid token=token %}
in your registration/password_reset_email.html
template, and replace it with 在您的
registration/password_reset_email.html
模板中,并将其替换为
{% url 'password_reset_confirm' uidb64=uid token=token %}
If that doesn't solve the problem, then you need to find out where the warning is coming from. 如果那不能解决问题,那么您需要找出警告的来源。 You can run the dev server with the
-W
flag to turn warnings into exceptions . 您可以使用
-W
标志运行dev服务器,以将警告变为异常 。
python -W error manage.py runserver
When you send the password reset email, you will get a traceback which will show you where the problem is. 当您发送密码重置电子邮件时,您将得到一个回溯,它将向您显示问题出在哪里。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.