feat: initialize Django DRF skeleton
This commit is contained in:
+14
-11
@@ -110,18 +110,21 @@ MVP 不做:
|
||||
统一启动与验证入口收敛到根目录 `./init.sh`(Windows 原生 PowerShell 用 `./init.ps1`)。骨架落地后,真实命令大致为:
|
||||
|
||||
```bash
|
||||
# 安装依赖(建议 uv 或 venv + pip)
|
||||
uv sync # 或 pip install -r requirements.txt
|
||||
# 数据库迁移
|
||||
python manage.py migrate
|
||||
# 基础验证 / 测试
|
||||
python manage.py test
|
||||
# 本地开发启动
|
||||
python manage.py runserver
|
||||
# Windows PowerShell
|
||||
py -3.12 -m pip install -r requirements.txt
|
||||
py -3.12 manage.py check
|
||||
py -3.12 manage.py test
|
||||
py -3.12 manage.py runserver
|
||||
|
||||
# Unix / WSL
|
||||
python3.12 -m pip install -r requirements.txt
|
||||
python3.12 manage.py check
|
||||
python3.12 manage.py test
|
||||
python3.12 manage.py runserver
|
||||
```
|
||||
|
||||
说明:
|
||||
|
||||
- 改后端逻辑后跑:`python manage.py test`。
|
||||
- 改数据模型后跑:`python manage.py makemigrations && python manage.py migrate && python manage.py test`。
|
||||
- 如果命令当前不可运行(骨架未建),必须在回复里如实说明原因。
|
||||
- 改后端逻辑后跑:`py -3.12 manage.py test`(Windows)或 `python3.12 manage.py test`(Unix/WSL)。
|
||||
- 改数据模型后跑:`makemigrations && migrate && test`;T-002 接入 MySQL 与自定义 User 前不要提前迁移。
|
||||
- 如果命令当前不可运行,必须在回复里如实说明原因。
|
||||
|
||||
Reference in New Issue
Block a user