Django中的ROOT_URLCONF错误

时间:2015-02-16 14:08:38

标签: django

我在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 ......有什么想法吗?

1 个答案:

答案 0 :(得分:0)

应该是admin.site.urls,而不是admin.site.root

url(r'^admin/', include(admin.site.urls)),