From 5ccbf5785126db18c3cbd03f608a78f9c54fd0f30de4755cfae6ff0945bd04fa Mon Sep 17 00:00:00 2001 From: f4lco Date: Sun, 27 Jan 2019 20:47:27 +0100 Subject: [PATCH] Repair debug entry point after using absolute imports Using absolute imports broke the debug target due to a Werkzeug bug: https://github.com/pallets/werkzeug/issues/461 Solution is to avoid running Flask apps using "python -m", and to use "flask run". This also gets rid of the coverage exception for "__main__.py". --- .coveragerc | 3 --- Makefile | 2 +- stw_potsdam/__main__.py | 4 ---- 3 files changed, 1 insertion(+), 8 deletions(-) delete mode 100644 .coveragerc delete mode 100644 stw_potsdam/__main__.py diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 0067159..0000000 --- a/.coveragerc +++ /dev/null @@ -1,3 +0,0 @@ -[run] -omit = - stw_potsdam/__main__.py diff --git a/Makefile b/Makefile index 31ab68a..6728074 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -RUN = pipenv run python -m stw_potsdam +RUN=FLASK_APP="stw_potsdam.views" pipenv run flask run dependencies: pipenv sync --dev diff --git a/stw_potsdam/__main__.py b/stw_potsdam/__main__.py deleted file mode 100644 index f6c9858..0000000 --- a/stw_potsdam/__main__.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- encoding: utf-8 -*- -from views import app - -app.run()