該項目的urls.py是這個NameError:管理員在Django
from django.conf.urls.defaults import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'Sdr.views.home', name='home'),
# url(r'^Sdr/', include('Sdr.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
# url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
# Uncomment the next line to enable the admin:
url(r'^admin/', include(admin.site.urls)),
(r'', include('Sdr.sdr.urls')),
)
應用的urls.py看起來像這樣
# Import django modules
from django.conf.urls.defaults import *
from django.contrib import admin
# Import custom modules
import settings
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
(r'', include('Sdr.sdr.urls')),
)
我得到的錯誤是例外發現是
Django Version: 1.3
Exception Type: NameError
Exception Value:
name 'admin' is not defined
就像伊格納西奧說你要取消對進口管理和自動發現 – dm03514 2011-05-31 14:00:36