AttributeError: 'Settings' object has no attribute 'ROOT_URLCONF'

Jess picture Jess · Oct 11, 2012 · Viewed 37.1k times · Source

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?

Answer

defuz picture defuz · Oct 11, 2012

From django docs:

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.

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.

And

ROOT_URLCONF

Default: Not defined

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.