settings.py 559 B

12345678910111213141516171819
  1. """Database settings reused from the existing backend application.
  2. Credentials stay in the project's single source of truth (``数据库.md`` read by
  3. ``backend/app/config.py``); this module only exposes them to ``models/`` without
  4. copying any secret.
  5. """
  6. from __future__ import annotations
  7. import sys
  8. from pathlib import Path
  9. ROOT = Path(__file__).resolve().parents[2]
  10. BACKEND = ROOT / "backend"
  11. if str(BACKEND) not in sys.path:
  12. sys.path.insert(0, str(BACKEND))
  13. from app.config import settings # noqa: E402
  14. __all__ = ["settings", "ROOT", "BACKEND"]