自学到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',
)
问题解决