a9d1b0e416
上轮 3 次 commit 只入库了修补文件,主体目录漏入库。本次补入 backend/app/、backend/requirements.txt、backend/scripts/__init__.py。同步在 .gitignore 加 homePC/(制片人家用机带过来的参考文件,不进库)。
19 lines
413 B
Python
19 lines
413 B
Python
"""
|
|
应用配置 — 用 pydantic-settings 的 BaseSettings 读取 .env
|
|
"""
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
DATABASE_URL: str
|
|
SECRET_KEY: str = "change-me-to-a-random-string-in-production"
|
|
SESSION_MAX_AGE: int = 86400 # 秒,默认 1 天
|
|
|
|
model_config = {
|
|
"env_file": ".env",
|
|
"env_file_encoding": "utf-8",
|
|
}
|
|
|
|
|
|
settings = Settings() |