问题描述
继我的上一个问题 错误:没有名为 psycopg2.extensions 的模块,我已将我的 mac OS 更新为 Mountain Lion 并安装了 Xcode.我还使用sudo port install py27-psycopg2"安装了 psycopg2.我现在正在尝试运行python manage.py runserver",但收到此错误
Following on from my last question Error: No module named psycopg2.extensions, I have updated my mac OS to Mountain Lion and installed Xcode. I have also installed psycopg2 using 'sudo port install py27-psycopg2'. I am now trying to run 'python manage.py runserver' but am receiving this error
AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'
关于如何解决这个问题并让我的本地主机运行的任何帮助?
Any help on how to fix this and get my localhost running?
推荐答案
来自 django 文档:
From django docs:
Django 设置文件包含 Django 安装的所有配置.当你使用 Django 时,你必须告诉它你正在使用哪些设置.通过使用环境变量 DJANGO_SETTINGS_MODULE 来执行此操作.
A Django settings file contains all the configuration of your Django installation. When you use Django, you have to tell it which settings you're using. Do this by using an environment variable,
DJANGO_SETTINGS_MODULE.
DJANGO_SETTINGS_MODULE 的值应该是 Python 路径语法,例如mysite.settings.请注意,设置模块应位于Python 导入搜索路径.
The value of DJANGO_SETTINGS_MODULE should be in Python path syntax,
e.g. mysite.settings. Note that the settings module should be on the
Python import search path.
和
ROOT_URLCONF
默认:未定义
代表根目录的完整 Python 导入路径的字符串网址配置.例如:mydjangoapps.urls".可以覆盖一个通过在传入的属性 urlconf 上设置每个请求的基础HttpRequest 对象.请参阅 Django 如何处理请求 了解详情.
A string representing the full Python import path to your root URLconf. For example: "mydjangoapps.urls". Can be overridden on a per-request basis by setting the attribute urlconf on the incoming HttpRequest object. See How Django processes a request for details.
这篇关于AttributeError:“设置"对象没有属性“ROOT_URLCONF"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)