You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
2 weeks ago | |
|---|---|---|
| .. | ||
| migrations | 2 weeks ago | |
| tests | 2 weeks ago | |
| {{ project_slug }} | 2 weeks ago | |
| .gitignore | 3 weeks ago | |
| README.md.jinja | 2 weeks ago | |
| app.py.jinja | 2 weeks ago | |
| config.py.jinja | 2 weeks ago | |
| copier.yml | 2 weeks ago | |
| pyproject.toml.jinja | 2 weeks ago | |
README.md.jinja
# {{ project_name }}
FastAPI 业务后端项目。
由 iTi-Flask Copier 模板生成。
## 依赖
默认使用私有 Git 依赖。
推荐固定 tag,也允许 branch。
`file://` 只建议框架开发者本机验证模板时使用。
## 初始化
```bash
uv sync --extra dev
uv run alembic upgrade head
```
{% if include_system %}
同步系统 migration 和 seed:
```bash
uv run iti-system migrations sync --target migrations/versions
uv run alembic upgrade head
uv run iti-system seed system app:app
```
{% endif %}
## 开发
```bash
uv run uvicorn app:app --reload
uv run pytest -q
```
## 数据库迁移
```bash
uv run alembic revision --autogenerate -m "alice add example table"
uv run alembic upgrade head
```
规则:
- `migrations/versions` 必须提交。
- migration message 第一个词写作者名。
- 生产只从 `main` 执行 `alembic upgrade head`。