我正在将 django 从前面的 1.4 升级到 1.5,一切顺利,但是当我尝试输入 url 时,管理员方面出现了这个特定错误,而不是如何修复它,有什么想法吗?
错误:
NoReverseMatch at /admin/
u"'admin" is not a registered namespace
Request Method: GET
Request URL: http://lmgsyco.com/admin/
Django Version: 1.4.1
Exception Type: NoReverseMatch
Exception Value:
u"'admin" is not a registered namespace
Exception Location: /usr/local/lib/python2.6/dist-packages/django/template/defaulttags.py in render, line 424
Python Executable: /usr/bin/python
Python Version: 2.6.6
网址:
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', web_page, name='web_page'),
url(r'^login/$', 'django.contrib.auth.views.login'),
url(r'^logout/$', cerrar_sesion, name='cerrar_sesion'),
# Admin:
url(r'^admin/', include(admin.site.urls)),
# Admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
)