From e5d4e2b2ab8e2d1786ad6bd827dfd4ba1d9d7fe1 Mon Sep 17 00:00:00 2001 From: nnayk <79224511+nnayk@users.noreply.github.com> Date: Thu, 7 Dec 2023 22:39:45 -0800 Subject: [PATCH] Add flask db connect b4 first request --- Backend/backend.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Backend/backend.py b/Backend/backend.py index 3bbba2b..0f07ffb 100644 --- a/Backend/backend.py +++ b/Backend/backend.py @@ -32,6 +32,11 @@ jwt = JWTManager(app) +@app.before_first_request +def before_first_request(): + db_access.db_connect() + + @app.route("/generate_image", methods=["POST"]) @jwt_required() def generate_image():