找不到带有关键字参数的“ password_reset_confirm”(紧跟着争议列表)

时间:2019-01-18 12:59:14

标签: django python-3.x

这里是django的新手。我正在尝试在我的应用程序中实现密码重置功能。我正在使用控制台电子邮件后端。

我正在使用Django 2.x和python3.5.x。当我输入电子邮件并点击 提交我得到以下错误 请告诉我如何消除此错误。

NoReverseMatch at /reset/. Reversefor'password_reset_confirm' with
keyword arguments '{'uidb64': 'NQ', 'token':'533-3b115e87321ed5f71bbe'}'     
not found

root urls.py

from django.contrib import admin
import boards
from django.urls import include, path, re_path
from django.contrib.auth import views as auth_views

urlpatterns = [
    path('boards/', include('boards.urls')),
    path('reset/', auth_views.PasswordResetView.as_view(
        template_name='boards/password_reset.html',
        email_template_name='boards/password_reset_email.html',
        subject_template_name='boards/password_reset_subject.txt',
    ), name='password_reset'),
    path('reset/done/', auth_views.PasswordResetDoneView.as_view(
        template_name='boards/password_reset_done.html'
    ), name='password_reset_done'),
    re_path('reset/<uidb64>/<token>/',auth_views.PasswordResetConfirmView.as_view(
    template_name='boards/password_reset_confirm.html'),
    name='password_reset_confirm'),
    path('reset/complete/',     auth_views.PasswordResetCompleteView.as_view(
    template_name='boards/password_reset_complete.html'

), name='password_reset_complete'),
    path('setting/password/',     auth_views.PasswordChangeView.as_view(template_name =     'boards/password_change.html'),name='password_change'),
    path('setting/password/done/',     auth_views.PasswordChangeDoneView.as_view(template_name='boards/password_cha    nge_done.html'), name='password_change_done'),
    path('admin/', admin.site.urls),
]

在下面的行中显示模板渲染过程中的错误

{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}

0 个答案:

没有答案