14 lines
424 B
Python
14 lines
424 B
Python
import os
|
|
from dotenv import load_dotenv
|
|
|
|
# Calcular ruta absoluta al .env
|
|
ENV_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'config', '.env'))
|
|
|
|
# Cargar el .env si existe
|
|
if os.path.exists(ENV_PATH):
|
|
load_dotenv(ENV_PATH)
|
|
else:
|
|
raise FileNotFoundError(f"No se encontró el archivo .env en {ENV_PATH}")
|
|
|
|
# Exponer la ruta como variable accesible al importar `entrypoint`
|
|
__all__ = ['ENV_PATH'] |