Skip to content

Instantly share code, notes, and snippets.

@byanofsky
Created August 8, 2017 15:30
Show Gist options
  • Save byanofsky/957c464c49cb46d282df19fb2e59df80 to your computer and use it in GitHub Desktop.
Save byanofsky/957c464c49cb46d282df19fb2e59df80 to your computer and use it in GitHub Desktop.
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