-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfig.py
66 lines (50 loc) · 1.91 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config(object):
# Flask specifics
SECRET_KEY = os.environ.get('FLASK_SECRET_KEY') or 'you-will-never-guess'
WTF_CSRF_SECRET_KEY = os.environ.get('CSRF_SECRET_KEY') or SECRET_KEY
SQLALCHEMY_TRACK_MODIFICATIONS = False
# details provided by Auth0 following registration of an app
AUTH0_CLIENT_ID = os.environ.get('AUTH0_CLIENT_ID') or ''
AUTH0_CLIENT_SECRET = os.environ.get('AUTH0_CLIENT_SECRET') or ''
AUTH0_CLIENT_DOMAIN = os.environ.get('AUTH0_CLIENT_DOMAIN') or ''
LOGGING_CONFIG = "development"
CDN_DEBUG = False
CDN_DOMAIN = os.environ.get('CDN_DOMAIN') or ''
CDN_HTTPS = True
CDN_TIMESTAMP = False
# staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
SQLALCHEMY_ECHO = True
CDN_DEBUG = True
SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or 'sqlite:///' + os.path.join(basedir, 'app.db')
LOGGING_CONFIG = "development"
class TestingConfig(Config):
TESTING = True
CDN_DEBUG = True
LIVESERVER_PORT = 8943
SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL') or 'sqlite:///' + os.path.join(basedir, 'test_app.db')
LOGGING_CONFIG = "test"
class StagingConfig(Config):
DEBUG = False
SQLALCHEMY_ECHO = False
CDN_DEBUG = False
SQLALCHEMY_DATABASE_URI = os.environ.get('STAGING_DATABASE_URL') or \
'sqlite:///' + os.path.join(basedir, 'stage_app.db')
LOGGING_CONFIG = "test"
class ProductionConfig(Config):
DEBUG = False
CDN_DEBUG = False
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or 'sqlite:///' + os.path.join(basedir, 'prod_app.db')
LOGGING_CONFIG = "production"
app_config = {
'development': DevelopmentConfig,
'production': ProductionConfig,
'testing': TestingConfig,
'staging': StagingConfig,
'default': DevelopmentConfig
}