-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig.py
41 lines (29 loc) · 1.11 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
# -*- coding: utf-8 -*-
import os
"""ENV: Flask application environment.
Examples: `development`, `production`, `testing`.
"""
ENV = os.getenv("FLASK_ENV", "development")
"""SECRET_KEY: Secret key used for signing cookies and tokens.
Application will fail to start if $FLASK_SECRET is not set.
"""
try:
SECRET_KEY = os.getenv("FLASK_SECRET").encode("utf-8")
except AttributeError: # pragma: no cover
raise RuntimeError("Environment variable $FLASK_SECRET was not set")
"""LOGGING_CONFIG: Path to logging configurations.
Logger extension will read configurations from the specified file.
"""
LOGGING_CONFIG = os.getenv("LOGGING_CONFIG", f"instance/{ENV}/logging.yaml")
"""APISPEC_SWAGGER_URL: URL for swagger.json file.
Set None to disable serving this resource.
"""
APISPEC_SWAGGER_URL = "/myapi/apispec/spec"
"""APISPEC_SWAGGER_UI_URL: URL for swagger-ui.
Set None to disable serving this view.
"""
APISPEC_SWAGGER_UI_URL = "/myapi/apispec"
"""PROPAGATE_EXCEPTIONS: Flag to bypass FR error handlers for custom exceptions.
Set this to False if you want to use FR error handlers instead.
"""
PROPAGATE_EXCEPTIONS = True