From: Carl Worth Date: Tue, 29 Sep 2020 15:35:46 +0000 (-0700) Subject: Convert "make run" to use "flask run" instead of direct python script execution X-Git-Url: https://git.cworth.org/git?p=turbot;a=commitdiff_plain;h=1bcc971443fe6298ec1c719dd6b0495433f9a1e9 Convert "make run" to use "flask run" instead of direct python script execution This will simplify some future work (regarding reorganizing the code into a package, etc.) so that we don't have to try to simultaneously support running as both a script and as a module. --- diff --git a/Makefile b/Makefile index 5199e6a..d38a9a9 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ endif pip-compile --no-index --generate-hashes --allow-unsafe run: require-venv - python3 ./turbot.py + FLASK_APP=turbot FLASK_DEBUG=true flask run turbot.wsgi: turbot.wsgi.in Makefile envsubst < turbot.wsgi.in > turbot.wsgi diff --git a/turbot.py b/turbot.py index 7371dc2..5095d2a 100755 --- a/turbot.py +++ b/turbot.py @@ -103,6 +103,3 @@ def rot(): @slack_events.on("error") def handle_error(error): app.logger.error("Error from Slack: " + str(error)) - -if __name__ == '__main__': - app.run(debug=True)