-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
forward args to flask from wsgi (#573)
Co-authored-by: Guilherme Bufolo <[email protected]>
- Loading branch information
Showing
2 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import gevent.monkey | ||
gevent.monkey.patch_all() | ||
|
||
from app import app, socketio, celery_app | ||
import argparse | ||
import os | ||
|
||
from app import app, socketio | ||
from app.config import UPLOAD_FOLDER | ||
|
||
def parse_arguments(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--host", required=False, default=None, type=str, nargs="?", help="Set the host to use. Forwarded to flask.") | ||
parser.add_argument("--debug", required=False, default=True, type=bool, help="Set the debug flag. Forwarded to flask.") | ||
|
||
return parser.parse_args() | ||
|
||
|
||
if __name__ == "__main__": | ||
arguments = parse_arguments() | ||
if not os.path.exists(UPLOAD_FOLDER): | ||
os.makedirs(UPLOAD_FOLDER) | ||
socketio.run(app, debug=True) | ||
socketio.run(app, debug=arguments.debug, host=arguments.host) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters