-
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathmain.py
More file actions
17 lines (15 loc) · 720 Bytes
/
main.py
File metadata and controls
17 lines (15 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys
from server import app, talisman
if __name__ == "__main__":
# This is used when running locally. Gunicorn is used to run the
# application on Google App Engine. See entrypoint in app.yaml.
# If the 'background' command line argument is given:
# python main.py background &
# then run in non-debug mode, as debug mode can't be backgrounded
# but debug mode is useful in general (as auto reloads on change)
if len(sys.argv) > 1 and sys.argv[1] == "background":
# Turn off HTTPS redirects (automatically turned off for debug)
talisman.force_https = False
app.run(host="0.0.0.0", port=8080)
else:
app.run(host="0.0.0.0", port=8080, debug=True)