forked from tbj128/mian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
33 lines (28 loc) · 768 Bytes
/
run.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
from mian.main import app
import os
import json
import logging.config
def setup_logging(
default_path='logging.json',
default_level=logging.INFO,
env_key='LOG_CFG'
):
"""Setup logging configuration
"""
path = default_path
value = os.getenv(env_key, None)
if value:
path = value
if os.path.exists(path):
with open(path, 'rt') as f:
config = json.load(f)
logging.config.dictConfig(config)
else:
logging.basicConfig(level=default_level)
app.secret_key = 'Twilight Sparkle'
app.config['SESSION_TYPE'] = 'filesystem'
app.config['DEBUG'] = True
print("App Startup")
# app.run(debug=True, port=8080)
# app.run(host='0.0.0.0', debug=True, port=8080)
app.run(threaded=False, processes=3)