thesteve
thesteve

Reputation: 2503

Django cannot find admin.sites.url

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'^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.

Upvotes: 1

Views: 2021

Answers (1)

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)),
)

Upvotes: 1

Related Questions