0.4.0 convex及界面修改
This commit is contained in:
@@ -1,11 +1,19 @@
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""集中管理项目配置,来源于 .env / 环境变量。"""
|
||||
ENV_ALL_PATH = Path(__file__).resolve().parents[2] / ".env.all"
|
||||
|
||||
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""集中管理项目配置,来源于 .env.all / 环境变量。"""
|
||||
|
||||
# 约定:全局仅使用仓库根目录的 .env.all 作为配置来源(生产优先)。
|
||||
# 说明:这里使用绝对路径,避免因 cwd 不同导致读取失败。
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=str(ENV_ALL_PATH), env_file_encoding="utf-8", extra="ignore"
|
||||
)
|
||||
|
||||
# 说明:项目迁移到 Convex 的过程中,后端可能暂时不依赖 Supabase。
|
||||
# 因此这里给出空字符串默认值,避免本地未配置 .env 时无法启动开发服务器。
|
||||
|
||||
Reference in New Issue
Block a user