Created
August 8, 2017 15:30
-
-
Save byanofsky/957c464c49cb46d282df19fb2e59df80 to your computer and use it in GitHub Desktop.
Flask configuration which allows different settings depending on the environment
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
import os | |
# Get environment, or set to development by default | |
app_env = os.environ.get('APPLICATION_ENVIRONMENT') or 'development' | |
# Settings applied to all environments | |
SECRET_KEY = 'development key' | |
# Settings applied to specific environments | |
if app_env == 'production': | |
DATABASE_URI = '' # TODO: Enter your production database | |
DEBUG = False | |
elif app_env == 'development': | |
DATABASE_URI = '' # TODO: Enter your dev database | |
DEBUG = True | |
elif app_env == 'testing': | |
DATABASE_URI = '' # TODO: Enter your test database |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment