import os basedir = os.path.abspath(os.path.dirname(__file__)) class BaseConfig: USE_MOCK_EQUIVALENCY = False DEBUG = False class DevelopmentConfig(BaseConfig): CONFIG_NAME = 'dev' SECRET_KEY = os.getenv( "DEV_SECRET_KEY", "You can't see California without Marlon Brando's eyes") DEBUG = True TESTING = False SQLALCHEMY_DATABASE_URI = "sqlite:///{0}/app-dev.db".format(basedir) class TestingConfig(BaseConfig): CONFIG_NAME = 'test' SECRET_KEY = os.getenv("TEST_SECRET_KEY", "Thanos did nothing wrong") DEBUG = True TESTING = True SQLALCHEMY_DATABASE_URI = "sqlite:///{0}/app-test.db".format(basedir) class ProductionConfig(BaseConfig): CONFIG_NAME = 'prod' SECRET_KEY = os.getenv("PROD_SECRET_KEY", "I'm Ron Burgundy?") DEBUG = False TESTING = False SQLALCHEMY_DATABASE_URI = "sqlite:///{0}/app-prod.db".format(basedir) EXPORT_CONFIGS = [DevelopmentConfig, TestingConfig, ProductionConfig] config_by_name = {cfg.CONFIG_NAME: cfg for cfg in EXPORT_CONFIGS}