This commit is contained in:
2025-11-11 16:58:03 +01:00
parent f23f4b71d8
commit 324751eb5d
14 changed files with 1108 additions and 18 deletions

View File

@@ -6,14 +6,25 @@ from dotenv import load_dotenv
from pathlib import Path
# Load environment variables from backend/.env
backend_dir = Path(__file__).parent.parent / 'backend'
env_path = backend_dir / '.env'
# Try multiple locations (Docker vs local)
env_locations = [
Path('/app/.env'), # Docker location
Path(__file__).parent.parent / 'backend' / '.env', # Local location
Path(__file__).parent / '.env', # Current directory
]
if env_path.exists():
load_dotenv(dotenv_path=env_path)
print(f"✓ Loaded configuration from: {env_path}")
else:
print(f"⚠ Warning: .env file not found at {env_path}")
env_loaded = False
for env_path in env_locations:
if env_path.exists():
load_dotenv(dotenv_path=env_path)
print(f"✓ Loaded configuration from: {env_path}")
env_loaded = True
break
if not env_loaded:
print(f"⚠ Warning: .env file not found in any of these locations:")
for loc in env_locations:
print(f" - {loc}")
class Config: