forked from bokeh/bokeh
-
Notifications
You must be signed in to change notification settings - Fork 1
/
runserver.py
30 lines (23 loc) · 882 Bytes
/
runserver.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
import argparse, sys
from bokeh.server import start
import logging
parser = argparse.ArgumentParser(description="Start the Bokeh plot server")
parser.add_argument("-d", "--debug", action="store_true", default=False)
parser.add_argument("-j", "--debugjs", action="store_true", default=False)
parser.add_argument("-v", "--verbose", action="store_true", default=False)
args = parser.parse_args(sys.argv[1:])
start.prepare_app()
start.prepare_local()
start.bokeh_app.debugjs = args.debugjs
if args.debug:
start.bokeh_app.debug = True
start.app.debug = True
logging.basicConfig(level=logging.DEBUG)
import werkzeug.serving
@werkzeug.serving.run_with_reloader
def helper():
# Always set to verbose if in debug mode
start.start_app(verbose=True)
else:
logging.basicConfig(level=logging.INFO)
start.start_app(verbose=args.verbose)