How do I use multiple settings file in Django with multiple sites on one server?
- by William Bing Hua
I have an ec2 instance running Ubuntu 14.04 and I want to host two sites from it. On my first site I have two settings file, production_settings.py and settings.py (for local development). I import the local settings into the production settings and override any settings with the production settings file.
Since my production settings file is not the default settings.py name, I have to create an environment variable
DJANGO_SETTINGS_MODULE='site1.production_settings'
However because of this whenever I try to start my second site it says
No module named site1.production_settings
I am assuming that this is due to me setting the environment variable. Another problem is that I won't be able to use different settings file for different sites.
How do I start use two different settings file for two different websites?