Last active
November 9, 2017 15:59
-
-
Save javamo/2e1fd2bf920eb435334e07aea9a0462e to your computer and use it in GitHub Desktop.
app/config.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import getenv | |
class Config: | |
SECRET_KEY = getenv('SECRET_KEY', 'hard to guess string') | |
PROPAGATE_EXCEPTIONS = True | |
SQLALCHEMY_ECHO = getenv('SQLALCHEMY_ECHO') == 'true' | |
SQLALCHEMY_DATABASE_URI = getenv('DATABASE_URL') | |
SQLALCHEMY_TRACK_MODIFICATIONS = True | |
@staticmethod | |
def init_app(app): | |
pass | |
class DevelopmentConfig(Config): | |
DEBUG = True | |
class TestingConfig(DevelopmentConfig): | |
TESTING = True | |
class StagingConfig(Config): | |
SQLALCHEMY_TRACK_MODIFICATIONS = False | |
class ProductionConfig(Config): | |
SQLALCHEMY_TRACK_MODIFICATIONS = False | |
config = dict( | |
development=DevelopmentConfig, | |
testing=TestingConfig, | |
staging=StagingConfig, | |
production=ProductionConfig, | |
default=DevelopmentConfig | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment