问题描述
我有一个带有倾斜前端的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:
它的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/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!