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.
iTi-Flask/copier-template
NoahLan 69c845aacd docs: 文档整理 2 weeks ago
..
migrations refactor: remove system module and related code 2 weeks ago
tests refactor: 重构框架项目,轻量微服务+copier+底包仓库依赖方式,而非代码直接进入 3 weeks ago
{{ project_slug }} refactor: 重构框架项目,轻量微服务+copier+底包仓库依赖方式,而非代码直接进入 3 weeks ago
.gitignore refactor: 重构框架项目,轻量微服务+copier+底包仓库依赖方式,而非代码直接进入 3 weeks ago
README.md.jinja docs: 文档整理 2 weeks ago
app.py.jinja refactor: remove system module and related code 2 weeks ago
config.py.jinja refactor: remove system module and related code 2 weeks ago
copier.yml refactor: remove system module and related code 2 weeks ago
pyproject.toml.jinja refactor: remove system module and related code 2 weeks ago

README.md.jinja

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# {{ project_name }}

这是由 iTi-Flask Copier 模板生成的业务后端项目。

业务代码只扩展框架。
不要复制、覆盖或修改框架内部实现。

## 初始化

```bash
uv sync --extra dev
uv run python -m flask --app app.py db upgrade
```

## 开发

```bash
uv run python -m flask --app app.py run --debug
uv run --extra dev pytest
```

## 数据库迁移

生成 migration

```bash
uv run python -m flask --app app.py db migrate -m "alice add example table"
```

升级数据库:

```bash
uv run python -m flask --app app.py db upgrade
```

规则:

- `migrations/versions` 必须提交。
- migration message 第一个词写作者名,后面自由描述。
- 生产只从 `main` 执行 `flask db upgrade`。
- 框架底座不提供系统业务 migration。

## 系统业务

{% if include_system %}
本项目已引入 `iti-system`。
初始化和维护命令以 `iTi-System` 文档为准。
{% else %}
本项目未引入 `iti-system`。
因此没有系统业务能力。

后续需要系统业务时,增加 `iti-system` 依赖,并在 `app.py` 注册:

```python
from iti_system import create_system_module

modules=[
    ExampleModule(),
    create_system_module(),
]
```
{% endif %}