首个可运行的版本
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""应用配置 - 通过环境变量读取"""
|
||||
|
||||
from pydantic_settings import BaseSettings
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
# 数据库
|
||||
DATABASE_URL: str = "postgresql+asyncpg://qingye:qingye_secret@postgres:5432/qingye"
|
||||
|
||||
# Redis
|
||||
REDIS_URL: str = "redis://redis:6379/0"
|
||||
|
||||
# JWT
|
||||
JWT_SECRET_KEY: str = "qingye-jwt-secret-change-in-production"
|
||||
JWT_REFRESH_SECRET_KEY: str = "qingye-refresh-secret-change-in-production"
|
||||
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
||||
JWT_REFRESH_TOKEN_EXPIRE_DAYS: int = 7
|
||||
|
||||
# CORS
|
||||
CORS_ORIGINS: str = "http://localhost:5173"
|
||||
|
||||
# 管理员默认密码
|
||||
ADMIN_PASSWORD: str = "admin123"
|
||||
|
||||
# 上传
|
||||
MAX_UPLOAD_SIZE_MB: int = 10
|
||||
UPLOAD_DIR: str = "/app/uploads"
|
||||
|
||||
model_config = {"env_file": ".env", "extra": "ignore"}
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user