33 lines
651 B
Markdown
33 lines
651 B
Markdown
# fastapi 简单项目模板
|
|
|
|
## 初始化
|
|
|
|
```shell
|
|
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
```
|
|
|
|
修改 `alembic.ini:63` 更改为你的mysql配置
|
|
修改 `app/core/config.py:11` 为同样的配置
|
|
执行
|
|
|
|
```shell
|
|
alembic upgrade head
|
|
```
|
|
|
|
后续如果要对数据表进行修改, 建议使用alembic
|
|
基本使用请查阅官方文档
|
|
|
|
项目入口: main.py
|
|
|
|
## 提一嘴
|
|
|
|
复杂项目请参考[full-stack-fastapi-postgresql](https://github.com/tiangolo/full-stack-fastapi-postgresql)
|
|
|
|
或直接运行
|
|
|
|
```shell
|
|
pip install cookiecutter
|
|
cookiecutter https://github.com/tiangolo/full-stack-fastapi-postgresql
|
|
```
|
|
|