Skip to content

Instantly share code, notes, and snippets.

@SpComb
Created September 18, 2014 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SpComb/d4b7335dc2bbc30215e3 to your computer and use it in GitHub Desktop.
Save SpComb/d4b7335dc2bbc30215e3 to your computer and use it in GitHub Desktop.
fooproject/settings/__init__.py
## Import common settings
from fooproject.settings.base import *
from fooproject.settings.fooapp import *
### Load additional configuration
## Do we have explicit configuration?
ETC_PATH = os.path.join(DATA_PATH, 'etc/settings.d')
if os.path.exists(ETC_PATH) :
from glob import glob
# include from etc/settings.d/*.py
for config in glob(os.path.join(ETC_PATH, '*.py')) :
execfile(config)
else :
# use development configuration for plain source checkouts
from fooproject.settings.development import *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment