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.
This commit is contained in:
parent
c0e084aa86
commit
d20f402d89
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user