From 1bcc971443fe6298ec1c719dd6b0495433f9a1e9 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Tue, 29 Sep 2020 08:35:46 -0700 Subject: [PATCH] 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. --- Makefile | 2 +- turbot.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) 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) -- 2.43.0