Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django NoReverseMatch at/accounts/password/reset/confirm_Django - Fatal编程技术网

Django NoReverseMatch at/accounts/password/reset/confirm

Django NoReverseMatch at/accounts/password/reset/confirm,django,Django,我正在使用django userena并收到错误。在提交密码重置的电子邮件地址后,我收到了一封密码重置确认邮件。邮件正文如下 You're receiving this e-mail because you requested a password reset for your user account at example.example.com. Please go to the following page and choose a new password: http://examp

我正在使用django userena并收到错误。在提交密码重置的电子邮件地址后,我收到了一封密码重置确认邮件。邮件正文如下

You're receiving this e-mail because you requested a password reset
for your user account at example.example.com.

Please go to the following page and choose a new password:

http://example.example.com/accounts/password/reset/confirm/Mg-3xm-add2c70e92d3694c5043/



Your username, in case you've forgotten: ****


Thanks for using our site!

Sincerely,
example.example.com
但是在点击链接选择新密码后,我得到了以下错误

NoReverseMatch at /accounts/password/reset/confirm/Mg-3xm-add2c70e92d3694c5043/
Reverse for 'password_reset_complete' with arguments '()' and keyword arguments '{}' not    found. 0 pattern(s) tried: []
Request Method: GET
Request URL:    http://med.finder-lbs.com/accounts/password/reset/confirm/Mg-3xm-   add2c70e92d3694c5043/
Django Version: 1.6.1
Exception Type: NoReverseMatch
Exception Value:    
Reverse for 'password_reset_complete' with arguments '()' and keyword arguments '{}' not     found. 0 pattern(s) tried: []
url.py

url(r'^resetpassword/passwordsent/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'),
url(r'^password/reset/$',
   auth_views.password_reset,
   {'template_name': 'userena/password_reset_form.html',
    'email_template_name': 'userena/emails/password_reset_message.txt',
    'extra_context': {'without_usernames': userena_settings.USERENA_WITHOUT_USERNAMES}
    },
   name='userena_password_reset'),
url(r'^password/reset/done/$',
   auth_views.password_reset_done,
   {'template_name': 'userena/password_reset_done.html'},
   name='userena_password_reset_done'),
url(r'^user/password/reset/confirm/$',
         'django.contrib.auth.views.password_reset_confirm'),
url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
   auth_views.password_reset_confirm,
   {'template_name': 'userena/password_reset_confirm_form.html'},
   name='userena_password_reset_confirm'),

url(r'^password/reset/confirm/complete/$',
   auth_views.password_reset_complete,
   {'template_name': 'userena/password_reset_complete.html'}),
我很确定这里缺少了一些东西,但我无法找到它。我正在使用django 1.6

# urls.py
url(r'^password/reset/confirm/complete/$',
   auth_views.password_reset_complete,
   {'template_name': 'userena/password_reset_complete.html'},
   name='password_reset_complete') # must be named for reverse to work
命名url应该可以解决您的NoReverseMatch错误


但是,听起来您可能有另一个问题,因为您将此错误描述为在单击重置链接后立即发生,这意味着
password\u reset\u confirm
视图试图立即将用户重定向到
password\u reset\u complete
,而不是在用户选择了新密码之后。

您为什么再次更改URL?不,我以前在@BurhanKhalid处更改过它。您从哪里获得此
URL.py
?BurhanKhalid,别弄错了,也别迷惑了,我已经编辑了我的帖子。url之前已经编辑过了,我刚在帖子末尾提到过,我已经删除了那个部分@BurhanKhalidAre你确定吗?这是。我相信你没有正确设置你的项目,因为你不应该以任何方式编辑或修改此文件。根据你的回答,它不起作用,顺便问一下,你认为发生错误的是什么类型的问题?你能帮我吗?我陷入了这件事。如果这没有解决问题(或改变你得到的错误),你的应用程序没有获取你的url.py。你是说整个url.py文件还是特定的url@Enrico@Rego它可能是应用程序使用的eithermy url.py文件,因为我已经在同一个url.py文件中设置了登录和注册的URL,并且注册和登录功能运行得非常好@恩里科
# urls.py
url(r'^password/reset/confirm/complete/$',
   auth_views.password_reset_complete,
   {'template_name': 'userena/password_reset_complete.html'},
   name='password_reset_complete') # must be named for reverse to work