Axiovora-X / backend /config.py
ZAIDX11's picture
Add files using upload-large-folder tool
b657fcc verified
"""Configuration helpers."""
import os
from typing import Optional
try:
from dotenv import load_dotenv
load_dotenv()
except Exception:
pass
def get_env(key: str, default: Optional[str] = None) -> Optional[str]:
return os.environ.get(key, default)
import os
try:
from dotenv import load_dotenv
load_dotenv()
except Exception:
# If python-dotenv isn't installed, continue with environment variables or defaults
try:
# If there's a local shim, call it
from dotenv import load_dotenv as _ld
_ld()
except Exception:
pass
# Default to an in-memory SQLite DB for tests/local development when DB_URL is not set
DB_URL = os.getenv('DB_URL') or 'sqlite:///:memory:'
SECRET_KEY = os.getenv('SECRET_KEY') or 'dev-secret'