Skip to content

Instantly share code, notes, and snippets.

@Porter97
Last active January 22, 2020 15:32
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 Porter97/d69606973283c3220842d45a2e51c971 to your computer and use it in GitHub Desktop.
Save Porter97/d69606973283c3220842d45a2e51c971 to your computer and use it in GitHub Desktop.
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get(‘SECRET_KEY’, ‘secret’)
STREAM_API_KEY = ‘’#Insert your Stream API key her
STREAM_SECRET = ‘’#Insert your Stream Secret here
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ.get(‘DEV_DATABASE_URL’) or \
‘sqlite:///’ + os.path.join(basedir, ‘data-dev.sqlite’)
class TestingConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = os.environ.get(‘TEST_DATABASE_URL’) or \
‘sqlite://’
WTF_CSRF_ENABLED = False
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get(‘DATABASE_URL’) or \
‘sqlite:///’ + os.path.join(basedir, ‘data/sqlite’)
@classmethod
def init_app(cls, app):
Config.init_app(app)
config = {
‘development’: DevelopmentConfig,
‘testing’: TestingConfig,
‘production’: ProductionConfig,
‘default’: DevelopmentConfig
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment