-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
56 lines (39 loc) · 1007 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# configuration file
from os import path, getenv
basedir = path.abspath(path.dirname(__file__))
class Config:
"""
Common configuration for all environments
"""
# insert here common config
# flask healthz config
HEALTHZ = {
"live": "py_dummy_service.healthz.liveness",
"ready": "py_dummy_service.healthz.readiness",
}
# backend url
BACKEND_URL = getenv("BACKEND_URL", "http://localhost:5000")
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
DEBUG = True
TESTING = False
DEBUG_METRICS = 1
LOG_LEVEL = "DEBUG"
class TestingConfig(Config):
DEBUG = False
TESTING = True
DEBUG_METRICS = 0
LOG_LEVEL = "INFO"
class ProductionConfig(Config):
DEBUG = False
TESTING = False
DEBUG_METRICS = 0
LOG_LEVEL = "INFO"
config = {
"development": DevelopmentConfig,
"testing": TestingConfig,
"production": ProductionConfig,
"default": ProductionConfig,
}