-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
executable file
·38 lines (35 loc) · 1.14 KB
/
app.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
from argparse import ArgumentParser
from dve.app import make_app, make_wsgi_app
# make_wsgi_app MUST be imported here
if __name__ == "__main__":
# Set up development HTTP server logging. This affects only the logging
# done by this server, not by the app, and not by the production server,
# which is run using Gunicorn which has its own logging configuration.
# See notes above re. logging.
log_level_choices = "NOTSET DEBUG INFO WARNING ERROR CRITICAL".split()
parser = ArgumentParser(
description="Run the Design Value Explorer Dash app"
)
parser.add_argument(
"-d",
"--debug",
default=False,
action="store_true",
help="Run in debug mode",
)
# TODO: Possibly remove; logging config is now in `logging.yml`.
parser.add_argument(
"-l",
"--loglevel",
help="Logging level",
choices=log_level_choices,
default=None,
)
args = parser.parse_args()
loglevel = args.loglevel or ("DEBUG" if args.debug else "INFO")
app = make_app()
app.run_server(
host='0.0.0.0',
port=5000,
debug=args.debug,
)