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.

  1. Make a settings folder in the same directory as manage.py.
  2. Put your different settings files in that folder (e.g. base.py and prod.py).
  3. 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 *
    
  4. Run your project and override the settings:

    $ python2.6 manage.py syncdb --settings=settings.prod
    

Tags:

Django