添加Ai 能力,重构项目结构
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
from .settings import Settings
|
||||
|
||||
_env = os.getenv("ENV", "dev")
|
||||
_env_files = {"dev": ".env", "test": ".env.test", "prod": ".env.prod"}
|
||||
|
||||
# 定位项目根目录(config 上两级)
|
||||
_project_root = Path(__file__).resolve().parent.parent.parent
|
||||
_env_file = _project_root / _env_files.get(_env, ".env")
|
||||
|
||||
if not _env_file.exists():
|
||||
raise FileNotFoundError(f".env 文件不存在: {_env_file}")
|
||||
|
||||
settings = Settings(_env_file=str(_env_file))
|
||||
|
||||
__all__ = ["settings"]
|
||||
Reference in New Issue
Block a user