Django 找不到 admin.sites.url
我正在使用 rc1.3 在本地开发一个 django 站点,在对 urls.py 文件进行了一些调整后,我收到了 django 无法导入 admin.site.urls 的错误消息。通过 urls.py 文件如下。
urlpatterns = patterns('',
# Example:
(r'^city/$', 'venue.views.city_index'),
(r'^accounts/', include('registration.urls')),
(r'^accountss/', include('registration.backends.simple.urls')),
(r'^profiles/', include('profiles.urls')),
(r'^admin/', include('admin.site.urls')),
(r'^city/(?P<city>[-\w]+)/$', 'venue.views.city_detail'),
(r'^city/(?P<city>[-\w]+)/venue/$', 'venue.views.venue_index'),
)
知道可能是什么原因造成的,谢谢。
I am developing a django site locally using rc1.3 and after making several adjustments to my urls.py file i am receiving error messages that django cannot import admin.site.urls. by urls.py file is below.
urlpatterns = patterns('',
# Example:
(r'^city/
Any idea what might be cause this, thanks.
, 'venue.views.city_index'),
(r'^accounts/', include('registration.urls')),
(r'^accountss/', include('registration.backends.simple.urls')),
(r'^profiles/', include('profiles.urls')),
(r'^admin/', include('admin.site.urls')),
(r'^city/(?P<city>[-\w]+)/
Any idea what might be cause this, thanks.
, 'venue.views.city_detail'),
(r'^city/(?P<city>[-\w]+)/venue/
Any idea what might be cause this, thanks.
, 'venue.views.venue_index'),
)
Any idea what might be cause this, thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://docs.djangoproject.com/en/ dev/intro/tutorial02/#activate-the-admin-site
不要包含字符串路径,实际导入管理模块并指向其网址。
http://docs.djangoproject.com/en/dev/intro/tutorial02/#activate-the-admin-site
Don't include the string path, actually import the admin module and point to its urls.