`

NameError: name 'admin' is not defined

阅读更多

步骤:

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')),
   去掉注释。

分享到:
评论
1 楼 jiguanghover 2011-11-25  
(r'^admin/', include('django.contrib.admin.urls')), 这句用的不对,应该引用'admin.site.urls',你再试试。

相关推荐

    Oracle sqldeveloper without jdk (win+linux)

    If the locale of the operating system is not English, a few UI elements, like default wizard buttons and Oracle error messages, may show up in the language of this locale. If the locale of the ...

    vue+mock.js实现前后端分离

    Account: "Admin", Password: "888888", }, }) .then((response) => { console.log(response); }) .catch((error) => { console.log(error); }); }, }, created() { Mock.mock(`${this.baseURL}/Get...

    Kettle-命令行使用.pdf

    - 在 Linux 中,参数以 `-` 分隔,如 `./kitchen.sh -rep=kettle1 -user=admin -pass=admin -level=Basic -job=job`。 ### 2. Pan —— 转换执行器 Pan 用于执行转换,其参数与 Kitchen 相似,但更专注于转换操作...

    PHP 仿陌陌直播

    开源RTMP server ...后台一键安装 直接访问入口即可 初始admin admin 采用Bootstrap3精确定制的lyui除了拥有100%bootstrap体验外,融合了更多适合国人使用的前端组建。并且一套代码适应多种屏幕大小

    Alfresco2.1下载和安装.pdf

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryRepositoryBootstrap' defined in classpath resource [alfresco/core-services-context.xml]: Invocation of...

    tomcat-5.5.23

    which means that the same directory is used for all relative path resolutions. <br>The administration and manager web applications, which are defined in the $CATALINA_BASE/conf/Catalina/...

    Professional C# 3rd Edition

    Distributing Code Using a Strong Name 427 Contents Distributing Code Using Certificates 429 Managing Zones 435 Summary 437 Chapter 15: Threading 439 Threading 439 Applications with Multiple Threads ...

    CodeIgniter中实现泛域名解析

    if (isset($_SERVER['SERVER_NAME'])) { $arrServerName = explode('.', $_SERVER['SERVER_NAME']); if (in_array($arrServerName[0], $domain)) { $this->uri_string = '/' . $arrServerName[0] . "/" . $this->...

Global site tag (gtag.js) - Google Analytics