-
Notifications
You must be signed in to change notification settings - Fork 5
/
common_config.py
56 lines (47 loc) · 1.47 KB
/
common_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
SECRET_KEY = 'iQfPvB6sZaNHqVFI5CJa9rM1xOEVHKIM0LwifT04yLsPlZhSSvaDuZXOgJFSpJVq'
REDIS_HOST = 'redis'
class Config:
DEBUG = False
SECURITY_PASSWORD_SALT = 'tilda'
SECRET_KEY = SECRET_KEY
SECURITY_TRACKABLE = False
JWT_SECRET_KEY = SECRET_KEY
JWT_TOKEN_LOCATION = ['cookies']
JWT_ACCESS_COOKIE_PATH = '/api/v0'
JWT_REFRESH_COOKIE_PATH = '/api/v0/auth/refresh'
JWT_SESSION_COOKIE = False
JWT_COOKIE_SECURE = True
# JWT_ACCESS_TOKEN_EXPIRES = timedelta(seconds=1)
# JWT_REFRESH_TOKEN_EXPIRES = timedelta(seconds=10)
MONGODB_SETTINGS = {
'host': 'mongodb',
'db': 'onelove',
}
REDIS_HOST = REDIS_HOST
CELERY_LOG_LEVEL = 'INFO'
CELERY_BROKER_URL = 'redis://{}:6379'.format(REDIS_HOST)
CELERY_RESULT_BACKEND = 'redis://{}:6379'.format(REDIS_HOST)
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT = ['json']
OPENAPI_URL_PREFIX = '/doc'
OPENAPI_REDOC_PATH = '/redoc'
OPENAPI_SWAGGER_UI_PATH = '/swaggerui'
OPENAPI_SWAGGER_UI_URL = '/static/swaggerui/'
OPENAPI_VERSION = '2.0.0'
@staticmethod
def init_app(app):
pass
class DevConfig(Config):
DEBUG = True
JWT_COOKIE_SECURE = False
SECURITY_SEND_REGISTER_EMAIL = False
class TestConfig(Config):
TESTING = True
JWT_COOKIE_SECURE = False
MONGODB_SETTINGS = {
'host': 'mongodb',
'db': 'onelovetest',
}
class ProdConfig(Config):
pass