-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
41 lines (29 loc) · 859 Bytes
/
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
from decouple import config
class Config(object):
SECRET_KEY = config('SECRET_KEY')
#CSRF_SESSION_KEY = SESSION_KEY
SQLALCHEMY_TRACK_MODIFICATIONS = True
migration_directory = 'migrations'
class Development(Config):
DEBUG = True
SQLALCHEMY_DATABASE_URI = config('DATABASE_PATH')
class Testing(Config):
TESTING = True
DEBUG = True
SQLALCHEMY_DATABASE_URI = config('DATABASE_PATH')
class Production(Config):
TESTING = False
DEBUG = False
app_config = {
'development': Development,
'testing': Testing,
'production': Production
}
def get_config():
"""Return env class."""
if config('ENV') == 'dev':
return app_config['development']
elif config('ENV') == 'test':
return app_config['testing']
elif config('ENV') == 'prod':
return app_config['production']