From d20f402d896d89a940fee41f4e9b25a20857f220 Mon Sep 17 00:00:00 2001 From: "Khajaameen455@" <157886355+Khajaamee455@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:31:15 +0530 Subject: [PATCH] Update main.py If load_dotenv() is not called before importing modules that rely on environment variables defined in the .env file, those modules might not be able to access the environment variables correctly. This could lead to errors or unexpected behavior in your code. --- backend/main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/main.py b/backend/main.py index 192ef22..4c71a51 100644 --- a/backend/main.py +++ b/backend/main.py @@ -1,13 +1,11 @@ -# Load environment variables first from dotenv import load_dotenv - -load_dotenv() - - from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from routes import screenshot, generate_code, home, evals +# Load environment variables first +load_dotenv() + app = FastAPI(openapi_url=None, docs_url=None, redoc_url=None) # Configure CORS settings