-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
53 lines (40 loc) · 1.37 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
import os
BASE_DIR = os.path.dirname(__file__)
DB_DIR = os.path.join(BASE_DIR, 'db')
if not os.path.exists(DB_DIR):
os.mkdir(DB_DIR)
# Flask Setting
DEBUG = True
TESTING = False
SECRET_KEY = 'your_secret_key'
JSON_SORT_KEYS = False
# Database Setting
SQLALCHEMY_DATABASE_URI = f'sqlite:///{DB_DIR}/gateway.db'
SQLALCHEMY_TRACK_MODIFICATIONS = False
# JWT Setting
JWT_SECRET_KEY = 'your_jwt_secret_key'
JWT_TOKEN_LOCATION = ['headers', 'cookies']
JWT_ACCESS_TOKEN_EXPIRES = 3600
# Log Setting
LOGGING_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
LOGGING_LOCATION = 'app.log'
LOGGING_LEVEL = 'INFO'
# Run Setting
# Port to listen on
LISTEN_PORT = 5000
# API method, optional POST, GET and MIXED.
# Note that if you choose to MIXED, you need to manually configure
# the method when configuring the api parameters
METHOD = 'POST'
# Authentication method, optional token, token-secret,
# token-signature, token-secret-signature
AUTH_METHOD = 'token-signature'
# Authentication encryption method, optional md5, sha256
ENCRYPTION = 'sha256'
# Data transmission method, optional args, form, json.
# We recommend using json. Note that if you choose form and json,
# please choose the POST method when configuring the API method.
TRANSMISSION_METHOD = 'json'
# Load balancing mode, including random, cycle, random-weight,
# cycle-weight four modes
BALANCE_MODE = 'random'