Created
May 18, 2016 15:18
-
-
Save neara/f9d17c5418a6f7e93ccb85a9745e5eb6 to your computer and use it in GitHub Desktop.
How init inside settings should look like for modular approach
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from base import * | |
env = os.environ.get('ENV') | |
if env == 'local': | |
from local import * | |
elif env == 'prod': | |
from production import * | |
else: | |
from local import * | |
# This is how to import additional settings files for all environments | |
# django celery pipeline settings | |
from pipeline import * | |
# This is to allow for developers to use their own settings and override localenv settings | |
try: | |
from local_settings import * | |
except ImportError: | |
pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would write it like this :)