`
MyEyeOfJava
  • 浏览: 1127856 次
  • 性别: Icon_minigender_1
  • 来自: 北京
博客专栏
7af2d6ca-4fe1-3e9a-be85-3f65f7120bd0
测试开发
浏览量:70280
533896eb-dd7b-3cde-b4d3-cc1ce02c1c14
晨记
浏览量:0
社区版块
存档分类
最新评论

no module named urls

阅读更多

自学到Django框架后台管理的时候,按照http://djangobook.py3k.cn/chapter06/书中所说的配置,缺出现了No module named urls的错误,查阅资料后,找到解决办法:

引用“

你肯定是看了以前的文档,却装的最新版django

admin的打开 新版的做法是打开 urls中如下设定,就好了。

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

 (r'^admin/(.*)', admin.site.root),

 

settings.py内的文件仍然按照书中所说的配置:

 

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    #'django.contrib.sites',
    #'django.contrib.messages',
     'demo.books',

    # Uncomment the next line to enable the admin:
     'django.contrib.admin',
    # Uncomment the next line to enable admin documentation:
    # 'django.contrib.admindocs',
)

 

问题解决

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics