您的位置:首页 > 编程语言 > Python开发

python django NameError: name 'admin' is not

2015-05-13 09:08 405 查看
步骤:

1、修改settings.py。在INSTALLED_APPS设置中添加“django.contrib.admin”。

2、运行python manage.py syncdb更新数据库

3、修改urls.py。改为:

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

admin.autodiscover()

 

# Uncomment this for admin:

   (r'^admin/',include('django.contrib.admin.urls')),

   去掉注释。

在运行时,遇到这种问题:注意空格的问题
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: