-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
53 lines (40 loc) · 1.13 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
from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore
from os import environ
class Config(object):
# SQL Alchemy
SQLALCHEMY_DATABASE_URI = environ.get(
'ENMS_DATABASE_URL',
'sqlite:///database.db?check_same_thread=False'
)
SQLALCHEMY_TRACK_MODIFICATIONS = False
# AP Scheduler
JOBS = []
SCHEDULER_JOBSTORES = {
'default': SQLAlchemyJobStore(url='sqlite:///flask_context.db')
}
SCHEDULER_API_ENABLED = True
SCHEDULER_EXECUTORS = {
'default': {
'type': 'threadpool',
'max_workers': 500
}
}
class DebugConfig(Config):
DEBUG = True
SECRET_KEY = environ.get('ENMS_SECRET_KEY', 'get-a-real-key')
class ProductionConfig(Config):
DEBUG = False
SECRET_KEY = environ.get('ENMS_SECRET_KEY')
# Vault
VAULT_ADDR = environ.get('VAULT_ADDR')
VAULT_TOKEN = environ.get('VAULT_TOKEN')
class SeleniumConfig(Config):
DEBUG = True
SECRET_KEY = 'key'
TESTING = True
LOGIN_DISABLED = True
config_dict = {
'Production': ProductionConfig,
'Debug': DebugConfig,
'Selenium': SeleniumConfig
}