-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfig.py
70 lines (47 loc) · 1.37 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
67
68
69
70
import os
from dmutils.status import get_version_label
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
VERSION = get_version_label(
os.path.abspath(os.path.dirname(__file__))
)
AUTH_REQUIRED = True
ELASTICSEARCH_HOST = 'localhost:9200'
DM_SEARCH_API_AUTH_TOKENS = None
DM_SEARCH_PAGE_SIZE = 30
DM_ID_ONLY_SEARCH_PAGE_SIZE_MULTIPLIER = 10
# Logging
DM_LOG_LEVEL = 'DEBUG'
DM_APP_NAME = 'search-api'
DM_PLAIN_TEXT_LOGS = False
DM_LOG_PATH = None
VCAP_SERVICES = None
DM_ELASTICSEARCH_SERVICE_NAME = "search_api_elasticsearch"
@staticmethod
def init_app(app):
pass
class Test(Config):
DEBUG = True
DM_PLAIN_TEXT_LOGS = True
DM_LOG_LEVEL = 'CRITICAL'
DM_SEARCH_API_AUTH_TOKENS = 'valid-token'
class Development(Config):
DEBUG = True
DM_PLAIN_TEXT_LOGS = True
DM_SEARCH_API_AUTH_TOKENS = 'myToken'
class SharedLive(Config):
"""Base config for deployed environments shared between GPaaS and AWS"""
DEBUG = False
class NativeAWS(SharedLive):
DM_APP_NAME = 'search-api'
DM_HTTP_PROTO = 'https'
class Live(SharedLive):
DM_LOG_PATH = '/var/log/digitalmarketplace/application.log'
config = {
'development': Development,
'native-aws': NativeAWS,
'preview': Live,
'staging': Live,
'production': Live,
'test': Test,
}