-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
31 lines (26 loc) · 855 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
# External modules
import argparse
import sys
# Local modules
from flaskapp.app import app
def get_args():
"""
Get command-line arguments
"""
parser = argparse.ArgumentParser()
parser.add_argument('--host',
type=str,
default='0.0.0.0',
help='Sets the host on which the app is to be run')
parser.add_argument('--port',
type=int,
default=5000,
help='Sets the port on which the app is to be run')
parser.add_argument('--debug',
action='store_true',
help='Run in debug mode')
args = parser.parse_args()
return args
if __name__ == "__main__":
args = get_args()
app.run(host=args.host, port=args.port, debug=args.debug)