-
Notifications
You must be signed in to change notification settings - Fork 4
/
run.py
36 lines (29 loc) · 920 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
33
34
35
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from app import app
import logging
try:
host = app.config['HOST']
except KeyError:
host = '127.0.0.1'
try:
port = app.config['PORT']
except KeyError:
port = 5000
try:
ssl = app.config['SSL']
except KeyError:
ssl = False
# Logging settings for development using werkzeug server
from flask.logging import default_handler
handler = default_handler
logging.getLogger('werkzeug').setLevel(logging.DEBUG)
logging.getLogger('werkzeug').addHandler(handler)
logging.getLogger('apscheduler.scheduler').setLevel(logging.INFO)
logging.getLogger('apscheduler.scheduler').addHandler(handler)
app.logger.setLevel(logging.DEBUG)
app.logger.addHandler(handler)
if ssl:
app.run(host=host, port=port, threaded=True, ssl_context=(app.config['SSL_CERT'], app.config['SSL_KEY']), debug=False)
else:
app.run(host=host, port=port, threaded=True, debug=False)