Spaces:
Sleeping
Sleeping
Download backend/env.py from t4transaction/agent: direct link, hf CLI and curl.
- Browser
- Download file 583 Bytes
-
https://huggingface.co/spaces/t4transaction/agent/resolve/main/backend/env.py
- Command line
-
hf download hf://spaces/t4transaction/agent/backend/env.py
-
curl -L -o env.py https://huggingface.co/spaces/t4transaction/agent/resolve/main/backend/env.py
583 Bytes
| """ | |
| Chargement centralise des variables d'environnement backend. | |
| """ | |
| from __future__ import annotations | |
| from pathlib import Path | |
| from dotenv import load_dotenv | |
| ROOT_DIR = Path(__file__).resolve().parent.parent | |
| BACKEND_DIR = Path(__file__).resolve().parent | |
| def load_backend_env() -> None: | |
| # Priorite aux variables deja presentes dans l'environnement systeme. | |
| # 1) .env racine (dev local / docker-compose) | |
| load_dotenv(ROOT_DIR / ".env", override=False) | |
| # 2) .env backend (override local optionnel par equipe) | |
| load_dotenv(BACKEND_DIR / ".env", override=False) | |