2013-07-06 48 views
1

我使用django 1.5.1與Django註冊1.0。django註冊URL無法解析

我得到一個錯誤:

NoReverseMatch at /accounts/password/reset/ 
Reverse for 'django.contrib.auth.views.password_reset_done' with arguments '()' and  keyword arguments '{}' not found. 
Request Method: GET 
Request URL: http://localhost:8000/accounts/password/reset/ 
Django Version: 1.5.1 
Exception Type: NoReverseMatch 
Exception Value:  
Reverse for 'django.contrib.auth.views.password_reset_done' with arguments '()' and keyword arguments '{}' not found. 

在我的urls.py我:

url(r'^accounts/', include('registration.backends.default.urls', namespace='re gistration', app_name='registration')), 

與在此之前任何人都遇到問題?

+0

你有沒有包含'django.contrib.auth.urls'? ([見這裏](https://github.com/django/django/blob/master/django/contrib/auth/urls.py))'registration.backends.default.urls'不提供登錄/註銷/密碼管理。 –

+0

是的。將它包含在一個新行url(r'^ account /',include('django.contrib.auth.urls'), – Max

回答

0

就包括以下幾行,它應該工作: url(r'accounts/', include('django.contrib.auth.urls')),

我的urls.py: ``` 從django.conf.urls進口模式,包括URL

從django.contrib中導入管理 admin.autodiscover()

URL模式=模式( '', #示例: #URL(R '^ $', 'django_registration_demo.views.home',名字= '家'), #URL(R '^博客/',包括( 'blog.urls')),

url(r'^admin/', include(admin.site.urls)), 
url(r'accounts/', include('django.contrib.auth.urls')), 
url(r'^accounts/', include('registration.backends.default.urls')) 

) ```