NoReverseMatch位于/rest-auth/password/reset/ [英] NoReverseMatch at /rest-auth/password/reset/

查看:69
本文介绍了NoReverseMatch位于/rest-auth/password/reset/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有倾斜前端的django应用程序.当从前端尝试发送passwordReset请求时,出现以下错误:

I have a django application with an angular front-end. When from the front-end I try to send a request for passwordReset, I get the following error:

带有参数'()'和关键字的'password_reset_confirm'的反向 参数'{​​u'uidb64':'MTE',u'token':u'3z4-eadc7ab3866d7d9436cb'}' 未找到.尝试了0个模式:[]

Reverse for 'password_reset_confirm' with arguments '()' and keyword arguments '{u'uidb64': 'MTE', u'token': u'3z4-eadc7ab3866d7d9436cb'}' not found. 0 pattern(s) tried: []

它的POST请求转到http://127.0.0.1:8080/rest-auth/password/reset/

Its a POST request going to http://127.0.0.1:8080/rest-auth/password/reset/

以下是我的urls.py的样子:

Following is what my urls.py looks like:

from django.conf.urls import patterns, include, url
from django.contrib import admin

urlpatterns = patterns('',
    url(r'^admin/', include(admin.site.urls)),
    url(r'^rest-auth/', include('rest_auth.urls')),
    url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
    url(r'^account/', include('allauth.urls'))
)

推荐答案

我也遇到了这个问题,并发现了这个

I also was having this problem, and found this github issue it said we need to add

url(r'^', include('django.contrib.auth.urls')),

在urlpatterns上.

on the urlpatterns.

如此处所述,它表示PasswordReset视图取决于django.contrib.auth.views.password_reset_confirm视图.

As stated there it says that The PasswordReset view depends on django.contrib.auth.views.password_reset_confirm view.

这篇关于NoReverseMatch位于/rest-auth/password/reset/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆