From abf24fe60f2b394d1162ee91d4999774f0ccee58 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 8 Apr 2024 13:15:58 +0100 Subject: [PATCH 1/2] Update FLASK_DEBUG_MODE setting to use value from settings module --- application/app.py | 2 +- application/core/settings.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/application/app.py b/application/app.py index ae619974..e646ffbe 100644 --- a/application/app.py +++ b/application/app.py @@ -40,5 +40,5 @@ def after_request(response): return response if __name__ == "__main__": - app.run(debug=True, port=7091) + app.run(debug=settings.FLASK_DEBUG_MODE, port=7091) diff --git a/application/core/settings.py b/application/core/settings.py index 0e1909e6..7eac3cb4 100644 --- a/application/core/settings.py +++ b/application/core/settings.py @@ -59,6 +59,8 @@ class Settings(BaseSettings): QDRANT_PATH: Optional[str] = None QDRANT_DISTANCE_FUNC: str = "Cosine" + FLASK_DEBUG_MODE: bool = False + path = Path(__file__).parent.parent.absolute() settings = Settings(_env_file=path.joinpath(".env"), _env_file_encoding="utf-8") From e07df29ab961a06bcc64b0ea317ace418604b633 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 8 Apr 2024 13:27:43 +0100 Subject: [PATCH 2/2] Update FLASK_DEBUG_MODE setting to use value from settings module --- application/wsgi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/wsgi.py b/application/wsgi.py index 5160e115..d0a7db07 100644 --- a/application/wsgi.py +++ b/application/wsgi.py @@ -1,4 +1,5 @@ from application.app import app +from application.core.settings import settings if __name__ == "__main__": - app.run(debug=True, port=7091) + app.run(debug=settings.FLASK_DEBUG_MODE, port=7091)