Skip to content

Commit

Permalink
Enable flask debug mode if running in vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
jojo141185 committed Oct 22, 2023
1 parent cec0b97 commit 45db50a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,12 +1368,12 @@ def lineup():

if __name__ == "__main__":
config = loadConfig()
if debugMode:
# If DEBUG is active, use default flask development sever in debug mode
if debugMode or ("TERM_PROGRAM" in os.environ.keys() and os.environ["TERM_PROGRAM"] == "vscode"):
# If DEBUG is active or code running In VS Code, use default flask development sever in debug mode
logger.info("ATTENTION: Server started in debug mode. Don't use on productive systems!")
# Flask server in debug mode can lead to errors in vscode debugger
#app.debug = debugMode
app.run(host="0.0.0.0", port=8001)
app.run(host="0.0.0.0", port=8001, debug=True)
# Note: Flask server in debug mode can lead to errors in vscode debugger ([errno 98] address in use)
# app.run(host="0.0.0.0", port=8001, debug=False)
else:
# On release use waitress server with multi-threading
waitress.serve(app, port=8001, _quiet=True, threads=24)

0 comments on commit 45db50a

Please sign in to comment.