| 1234567891011121314151617181920212223242526272829303132333435363738 |
- import os
- BASE_DIR = os.path.abspath(os.path.dirname(__file__))
- class Config:
- SECRET_KEY = os.getenv('SECRET_KEY', 'my_precious_secret_key')
- DEBUG = False
- class DevelopmentConfig(Config):
- # uncomment the line below to use postgres
- # SQLALCHEMY_DATABASE_URI = postgres_local_base
- DEBUG = True
- # SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'flask_boilerplate_test.db')
- # SQLALCHEMY_TRACK_MODIFICATIONS = False
- class TestingConfig(Config):
- DEBUG = True
- TESTING = True
- # SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'flask_boilerplate_test.db')
- PRESERVE_CONTEXT_ON_EXCEPTION = False
- # SQLALCHEMY_TRACK_MODIFICATIONS = False
- class ProductionConfig(Config):
- DEBUG = False
- # uncomment the line below to use postgres
- # SQLALCHEMY_DATABASE_URI = postgres_local_base
- config_by_name = dict(
- dev=DevelopmentConfig,
- test=TestingConfig,
- prod=ProductionConfig
- )
- key = Config.SECRET_KEY
|