python

学习过程中总结的经验

博客园 首页 新随笔 联系 订阅 管理

name 'admin' is not defined

In tutorial page 2, after you setup admin site, I get "name 'admin' is not defined" then a stacktrace.
add line from django.contrib import admin to the urls.py. so the file looks like below:
from django.conf.urls.defaults import *
from django.contrib import admin

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
# Example:
# (r'^django01/', include('django01.foo.urls')),

# Uncomment the admin/doc line below and add 'django.contrib.admindocs'
# to INSTALLED_APPS to enable admin documentation:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),

)
http://groups.wuyasea.com/profile/dorren/articles
posted on 2011-12-08 16:08  や尐莊徍左赱  阅读(420)  评论(0编辑  收藏  举报