我在urls.py中有这个:
ROOT_URLCONF = 'sdaps_web.urls'
访问url localhost:port时出现以下错误:
'AdminSite' object has no attribute 'root'
URLS配置:
url(r'^admin/(.*)', include(admin.site.urls)),
url(r'^', include(views)),
url(r'^', include(sdaps_ctl.views)),
url(r'^admin/(.*)', admin.site.root),
url(r'^accounts/', include('registration.urls')),
url(r'^$', direct_to_template,
{ 'template': 'index.html' }, 'index'),
我正在运行Django 1.6.1 ......有什么想法吗?
答案 0 :(得分:0)
应该是admin.site.urls
,而不是admin.site.root
:
url(r'^admin/', include(admin.site.urls)),