> 本章配套：理论课 `theory/ch04.html`　·　PPT `slides/ch04.pptx`　·　练习 `exercises/ch04.html`

# lab05_forms_and_upload

Forms & Upload。端口 **5101**　http://127.0.0.1:5101/

> 图文手册：**walkthrough.html**（配解释器 → 运行 → 每个页面，全部本机实拍）

## 1. Run

| 方式 | 操作 |
|---|---|
| PyCharm | 右上角运行配置选「lab05_forms_and_upload（5101）」→ 绿三角 |
| 双击 | `run.bat` |
| 命令行 | `..\.venv\Scripts\python.exe app.py` |

成功标志：`Running on http://127.0.0.1:5101`

## 2. Routes

| 地址 | 学到什么 |
|---|---|
| `/` | 四小节导航 |
| `/basic` | GET 与 POST 的区别 |
| `/upload` | 安全上传三重校验 |
| `/files` | 已上传文件列表 |
| `/post` | CKEditor 富文本发帖 |

## 3. Check

- [ ] PyCharm 右下角显示解释器，没有黄条
- [ ] 运行面板出现 `Running on http://127.0.0.1:5101`
- [ ] 上表每个地址都能打开，内容与 walkthrough 截图一致

## 4. Commands

```bat
cd lab05_forms_and_upload
..\.venv\Scripts\python.exe app.py
..\.venv\Scripts\python.exe -m flask --app app routes
```
