-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
39 lines (34 loc) · 1.01 KB
/
config.py
File metadata and controls
39 lines (34 loc) · 1.01 KB
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
import os
class Config():
if os.environ.get('SECRET_KEY'):
SECRET_KEY = os.environ.get('SECRET_KEY')
else:
pass
#raise Exception
class DevelopmentConfig(Config):
DEBUG = True
if os.environ.get('DEVELOPMENT_DATABASE_URL'):
SQLALCHEMY_DATABASE_URI = os.environ.get('DEVELOPMENT_DATABASE_URL')
else:
pass
#raise Exception
class TestingConfig(Config):
TESTING = True
if os.environ.get('TEST_DATABASE_URL'):
SQLALCHEMY_DATABASE_URI = os.environ.get('TEST_DATABASE_URL')
else:
pass
#raise Exception
class ProductionConfig(Config):
DEBUG = False
if os.environ.get('DATABASE_URL'):
SQLALCHEMY_DATABASE_URI = os.environ.get('DEVELOPMENT_DATABASE_URL')
else:
pass
#raise Exception
config = {
'development': DevelopmentConfig,
'testing': TestingConfig,
'production': ProductionConfig,
'default': DevelopmentConfig
}