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',
)

 

问题解决

目录
相关文章
from pymdownx import superfences No module named ‘pymdownx‘
from pymdownx import superfences No module named ‘pymdownx‘
108 0
|
4月前
|
Python
ModuleNotFoundError: No module named ‘fake_useragent‘
这篇文章提供了解决`ModuleNotFoundError: No module named 'fake_useragent'`错误的多种方法,包括重新运行安装命令、根据Python版本号指定安装、更新模块到最新版本以及使用whl文件安装。
ModuleNotFoundError: No module named ‘fake_useragent‘
Py3 ModuleNotFoundError: No module named ‘Crypto‘;ModuleNotFoundError: No module named Cryptodome‘
Py3 ModuleNotFoundError: No module named ‘Crypto‘;ModuleNotFoundError: No module named Cryptodome‘
101 0
|
Python
ModuleNotFoundError: No module named ‘pyexpat‘
ModuleNotFoundError: No module named ‘pyexpat‘
228 0
|
Python
ModuleNotFoundError: No module named ‘paramiko‘ 和ModuleNotFoundError: No module named ‘scp‘解决办法
ModuleNotFoundError: No module named ‘paramiko‘ 和ModuleNotFoundError: No module named ‘scp‘解决办法
647 0
ModuleNotFoundError: No module named ‘paramiko‘ 和ModuleNotFoundError: No module named ‘scp‘解决办法
ImportError: No module named _internal
ImportError: No module named _internal
101 0
|
Python
ModuleNotFoundError: No module named ‘Image‘
ModuleNotFoundError: No module named ‘Image‘
385 0
ModuleNotFoundError: No module named ‘Image‘
|
Python
ModuleNotFoundError: No module named 'utils'
ModuleNotFoundError: No module named 'utils'
1179 0