Skip to content

Instantly share code, notes, and snippets.

@jattoabdul
Created July 10, 2018 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jattoabdul/5253dcc2655c8f2ccbcb8c71a84b45f2 to your computer and use it in GitHub Desktop.
Save jattoabdul/5253dcc2655c8f2ccbcb8c71a84b45f2 to your computer and use it in GitHub Desktop.
Config env.py file.
from config import get_env
class EnvConfig(object):
"""Parent configuration class."""
DEBUG = False
CSRF_ENABLED = True
SECRET = get_env('SECRET')
class DevelopmentEnv(EnvConfig):
"""Configurations for Development."""
DEBUG = True
class TestingEnv(EnvConfig):
"""Configurations for Testing, with a separate test database."""
TESTING = True
DEBUG = True
class StagingEnv(EnvConfig):
"""Configurations for Staging."""
DEBUG = True
class ProductionEnv(EnvConfig):
"""Configurations for Production."""
DEBUG = False
TESTING = False
app_env = {
'development': DevelopmentEnv,
'testing': TestingEnv,
'staging': StagingEnv,
'production': ProductionEnv,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment