开发者

Django cannot find admin.sites.url

开发者 https://www.devze.com 2023-02-16 06:31 出处:网络
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 be

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/$', 'venue.views.city_index'),
(r'^accounts/', include('registration.urls')),
(r'^accountss/', include('registration.backends.simple.urls')),
(r'^开发者_StackOverflow中文版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'),
)

Any idea what might be cause this, thanks.


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.

from django.contrib import admin

urlpatterns += patterns('',
    (r'^admin/', include(admin.site.urls)),
)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号