Using a settings file other than settings.py in Django
this works for me:
DJANGO_SETTINGS_MODULE=config.settings.abc python manage.py migrate
I do know that no matter what you do with manage.py
, you're going to get that error because manage.py
does a relative import of settings
:
try:
import settings # Assumed to be in the same directory.
http://docs.djangoproject.com/en/dev/ref/django-admin/#django-admin-option---settings
Note that this option is unnecessary in manage.py, because it uses settings.py from the current project by default.
You should try django-admin.py syncdb --settings=mysettings
instead
Try creating a settings
module.
- Make a
settings
folder in the same directory asmanage.py
. - Put your different settings files in that folder (e.g.
base.py
andprod.py
). Make
__init__.py
and import whatever settings you want to use as your default. For example, your__init__.py
file might look like this:from base import *
Run your project and override the settings:
$ python2.6 manage.py syncdb --settings=settings.prod