AttributeError:'Settings'对象没有属性'ROOT_URLCONF' [英] AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'

查看:3289
本文介绍了AttributeError:'Settings'对象没有属性'ROOT_URLCONF'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于我最后一个问题错误:没有名为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 docs


Django设置文件包含Django安装的所有配置。
当您使用Django时,您必须告诉您使用哪些设置。
使用环境变量 DJANGO_SETTINGS_MODULE 执行此操作。

DJANGO_SETTINGS_MODULE 应该是Python路径语法,
eg 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导入路径到root
URLconf的字符串。例如:mydjangoapps.urls。通过在传入的
HttpRequest对象上设置属性urlconf,可以通过
每个请求来覆盖。请参阅 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:'Settings'对象没有属性'ROOT_URLCONF'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆