-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.py
48 lines (33 loc) · 1.1 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
import os
basedir = os.path.abspath(os.path.dirname(__file__))
def parse_var_env(var_name):
v = os.environ.get(var_name)
if v == "True":
v = True
elif v == "False":
v = False
return v
class Config(object):
ENV = 'production'
DEBUG = False
ELASTICSEARCH_URL = parse_var_env('ELASTICSEARCH_URL')
ELASTICSEARCH_CONFIG_DIR = parse_var_env('ELASTICSEARCH_CONFIG_DIR')
DOCUMENT_INDEX = parse_var_env('DOCUMENT_INDEX')
COLLECTION_INDEX = parse_var_env('COLLECTION_INDEX')
ALL_YEARS = parse_var_env('ALL_YEARS')
DTS_URL = parse_var_env('DTS_URL')
METADATA_FILE_URL = parse_var_env('METADATA_FILE_URL')
METADATA_FILE_INDEXABLE_COLUMNS = parse_var_env('METADATA_FILE_INDEXABLE_COLUMNS')
API_VERSION = parse_var_env('API_VERSION')
API_URL_PREFIX = parse_var_env('API_URL_PREFIX')
SEARCH_RESULT_PER_PAGE = parse_var_env('SEARCH_RESULT_PER_PAGE')
@staticmethod
def init_app(app):
pass
class DevelopmentConfig(Config):
ENV = 'development'
DEBUG = True
config = {
"dev": DevelopmentConfig,
"prod": Config,
}