Using a settings file other than settings.py in Django -


I want to use a different settings file in django - specifically settings_prod- - whenever I have a syncdb To - settings = settings_prod , it complains:

  python2.6 manage.py syncdb --settings = settings_prod Error: File 'settings.py' can not be found It seems that you have customized things in a directory with 'Manage.py'. To run django-admin.py, it must pass its settings module (if the file's Etats is actually present, so it is by no means generating import error.)   

I also try to set the environment variable DJANGO_SETTINGS_MODULE = settings_prod Is the end of

Edit: I have also set environment variables in my wsgi file, even to the end:

  import os import sys from django.core .handlers.wsgi Import WSGIHandler os.environ ['DJANGO_SETTINGS_MODULE'] = 'project.settings_prod' application = WSGIHandler ()   

Suggestions?

I know what you do with manage.py , You are taking that error because a relative imports of manage.py settings :

  Try: Import Settings # Assumed to be in the same directory.   

Note that this option is unnecessary in manage.py, because it uses settings.py by default from the current project.

You should try django-admin.py syncdb --settings = mysettings instead

Comments