Last active
April 4, 2017 07:22
-
-
Save sobolevn/44147d9f0002b0f04053e5d362e7ab7b to your computer and use it in GitHub Desktop.
medium-django-split-settings.py
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
""" | |
This is a django-split-settings main file. | |
For more information read this: | |
https://github.com/sobolevn/django-split-settings | |
Default environment is `developement`. | |
To change settings file: | |
`DJANGO_ENV=production python manage.py runserver` | |
""" | |
from split_settings.tools import optional, include | |
from os import environ | |
ENV = environ.get('DJANGO_ENV') or 'development' | |
base_settings = [ | |
'components/common.py', # standard django settings | |
'components/database.py', # postgres | |
'components/rq.py', # redis and redis-queue | |
'components/emails.py', # smtp | |
# You can even use glob: | |
# 'components/*.py' | |
# Select the right env: | |
'environments/%s.py' % ENV, | |
# Optionally override some settings: | |
optional('environments/local.py'), | |
] | |
# Include settings: | |
include(*base_settings) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment