-
Notifications
You must be signed in to change notification settings - Fork 0
/
cfg_example.py
99 lines (71 loc) · 2.35 KB
/
cfg_example.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from os import getenv
from cads.version import __version__
class Config:
OPENAPI_VERSION = '3.0.2'
INFO = {
'title': 'cwb-cads',
'description': 'cwb-cads: CWB-based API for Corpus-Assisted Discourse Studies',
'contact': {
'name': 'Philipp Heinrich',
'url': 'https://philipp-heinrich.eu',
'email': '[email protected]'
},
'version': __version__,
}
SERVERS = [
{
'name': 'Development Server',
'url': 'https://corpora.linguistik.uni-erlangen.de/cwb-cads-dev/'
},
{
'name': 'Local Server',
'url': 'http://127.0.0.1:5000/'
},
{
'name': 'Production Server',
'url': 'https://corpora.linguistik.uni-erlangen.de/cwb-cads/'
}
]
EXTERNAL_DOCS = {
'description': 'GitHub repository',
'url': 'https://github.com/ausgerechnet/cwb-cads'
}
SQLALCHEMY_TRACK_MODIFICATIONS = False
CCC_CQP_BIN = str(getenv('CQP_BIN', default='cqp'))
class ProdConfig(Config):
DEBUG = False
TESTING = False
SESSION_COOKIE_SECURE = True
SECRET_KEY = "CHANGE-ME-IN-PRODUCTION"
DB_NAME = 'mmda.sqlite'
ADMIN_PASSWORD = '0000'
CORPORA = 'tests/corpora/corpora.json'
CCC_REGISTRY_DIR = 'tests/corpora/registry/'
CCC_DATA_DIR = 'instance/cwb-cads-ccc-data-test/'
CCC_LIB_DIR = 'instance/cwb-cads-ccc-lib-test/'
JWT_ACCESS_TOKEN_EXPIRES = 60*30
JWT_REFRESH_TOKEN_EXPIRES = 60*60*12
class DevConfig(Config):
DEBUG = True
DB_NAME = 'mmda-dev.sqlite'
ADMIN_PASSWORD = '0000'
CORPORA = 'tests/corpora/corpora.json'
CCC_REGISTRY_DIR = 'tests/corpora/registry/'
CCC_DATA_DIR = 'instance/cwb-cads-ccc-data-test/'
CCC_LIB_DIR = 'instance/cwb-cads-ccc-lib-test/'
JWT_ACCESS_TOKEN_EXPIRES = False
JWT_REFRESH_TOKEN_EXPIRES = False
class TestConfig(Config):
DEBUG = True
TESTING = True,
APP_ENV = 'testing'
DB_NAME = 'mmda-test.sqlite'
ADMIN_PASSWORD = '0000'
CORPORA = 'tests/corpora/corpora.json'
CCC_REGISTRY_DIR = 'tests/corpora/registry/'
CCC_DATA_DIR = 'instance/cwb-cads-ccc-data-test/'
CCC_LIB_DIR = 'instance/cwb-cads-ccc-lib-test/'
JWT_ACCESS_TOKEN_EXPIRES = False
JWT_REFRESH_TOKEN_EXPIRES = False