Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Flask configuration which allows different settings depending on the environment
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