Created
March 2, 2019 01:15
-
-
Save andy23512/6a5c6488c2576be1bf1b659a45c380e5 to your computer and use it in GitHub Desktop.
Demonstration of overriding Django settings in different environment(e.g. development, test, production, ...)
This file contains 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 web.settings import * # import all settings from base settings web/settings.py | |
# overriding the settings | |
FORCE_SCRIPT_NAME = '' | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.postgresql', | |
'NAME': config['TEST_DATABASE']['name'], # this config comes from config.ini file | |
'USER': config['TEST_DATABASE']['username'], | |
'PASSWORD': config['TEST_DATABASE']['password'], | |
'HOST': config['TEST_DATABASE']['host'], | |
'PORT': config['TEST_DATABASE']['port'], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment