Spaces:
Paused
Paused
Upload 8 files
Browse files
config.py
CHANGED
|
@@ -6,10 +6,14 @@ from pathlib import Path
|
|
| 6 |
|
| 7 |
|
| 8 |
def _load_dotenv() -> None:
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
for env_path in candidates:
|
| 15 |
if not env_path.exists():
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
def _load_dotenv() -> None:
|
| 9 |
+
here = Path(__file__).resolve()
|
| 10 |
+
module_dir = here.parent
|
| 11 |
+
|
| 12 |
+
candidates: list[Path] = [module_dir / ".env"]
|
| 13 |
+
|
| 14 |
+
# Optional project-root fallback when running from full repository layout.
|
| 15 |
+
if len(here.parents) > 2:
|
| 16 |
+
candidates.append(here.parents[2] / ".env")
|
| 17 |
|
| 18 |
for env_path in candidates:
|
| 19 |
if not env_path.exists():
|