From 5caea84866c424d10666422dbaa2121eeea00af5 Mon Sep 17 00:00:00 2001 From: nnayk <79224511+nnayk@users.noreply.github.com> Date: Thu, 7 Dec 2023 22:28:57 -0800 Subject: [PATCH] Troubleshooting mongoengine issue --- Backend/backend.py | 5 +++-- Backend/db_access.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Backend/backend.py b/Backend/backend.py index a74bbb6..3bbba2b 100644 --- a/Backend/backend.py +++ b/Backend/backend.py @@ -100,8 +100,8 @@ def store_image(): image_res = requests.post( "https://api.imgur.com/3/image", data={"image": data["url"]}, - headers={"Authorization": "Client-ID " - + os.environ["IMGUR_CLIENT_ID"]}, + headers={"Authorization": "Client-ID " + + os.environ["IMGUR_CLIENT_ID"]}, ) # Prepare the data for creating an image @@ -255,6 +255,7 @@ def login(): @app.route("/register", methods=["POST"]) def register(): + print("IN REGISTER!!!") data = request.get_json() # Validate required fields diff --git a/Backend/db_access.py b/Backend/db_access.py index 7c8933e..6ef062e 100644 --- a/Backend/db_access.py +++ b/Backend/db_access.py @@ -26,7 +26,7 @@ def db_connect(DB_URL=None): # MongoDB connection mongo_uri = DB_URL or os.environ.get("MONGO_URI") - connect(host=mongo_uri) + connect(alias="default", host=mongo_uri) return True