I have lots of
from myproject.settings import param1
from myproject.settings import ...
scattered all over my project.
Upon startup, I would like to load different "settings" module according to env var (for example export SETTINGS=myproject.settings2)
I tried to put in the myproject.__init__.py
someting like
module_name = os.environ['SETTINGS']
m=__import__(module_name)
settings = m
but it won't work.
from myproject.settings import *
ImportError: No module named settings
How can this be achieved ?