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

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

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

# 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(,

posted on 2011-12-08 16:08  や尐莊徍左赱  阅读(420)  评论(0编辑  收藏  举报