Files
doluedu-fastapi-template/.env.example
ghplvh 981bee5a46 feat: 改造为开箱即用模板 — MySQL/MongoDB(Beanie) 一键切换 + AGENTS.md 开发规范
- src/ 按域组织骨架,示例域 items 双后端实现(SQLAlchemy2.0 async / Beanie 2.x)
- DB_BACKEND 环境变量切换,router 只依赖 Repo Protocol
- alembic 迁移(含初始 items 迁移)、uv 依赖管理、ruff、pytest 异步测试
- Dockerfile + docker-compose(app/mysql/mongo)
- AGENTS.md 重写为本模板开发规范;原最佳实践文档归档 docs/
- 验证:mongodb/mysql 双后端 pytest 全绿 + uvicorn 真实冒烟通过
2026-08-21 21:23:26 +08:00

20 lines
461 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ===== 数据库后端mysql 或 mongodb =====
DB_BACKEND=mongodb
# ===== MySQLDB_BACKEND=mysql 时必填)=====
MYSQL_DSN=mysql+aiomysql://root:root@127.0.0.1:3306/app?charset=utf8mb4
# ===== MongoDBDB_BACKEND=mongodb 时必填)=====
MONGO_DSN=mongodb://127.0.0.1:27017
MONGO_DB=app
# ===== 应用 =====
APP_NAME=fastapi-template
APP_ENV=dev
APP_DEBUG=true
APP_HOST=0.0.0.0
APP_PORT=8000
# 跨域,逗号分隔;* 仅调试用
CORS_ORIGINS=*