Modifing settings in Django

Posted by Cato Johnston on Stack Overflow See other posts from Stack Overflow or by Cato Johnston
Published on 2010-03-29T08:23:48Z Indexed on 2010/03/29 8:33 UTC
Read the original article Hit count: 404

Filed under:

I'm trying to get Django's manage.py to run with modified settings files.

I have three settings files

settings.py preview.py live.py

settings.py contains my base settings but on live & preview sites I point the ['DJANGO_SETTINGS_MODULE'] to live or preview which in turn load the base file and any settings specific to that environment.

This works fine, until I try to run migrations using manage.py

I updated the manage.py file to import settings.preview but now when I try to run syncdb or migrate I get this error:

django.core.exceptions.ImproperlyConfigured: You haven't set the DATABASE_ENGINE setting yet.

My settings file has this in it though:

DATABASE_ENGINE = 'mysql'

How can I get this to work?

© Stack Overflow or respective owner

Related posts about django