# todo-plain **Repository Path**: wangdong_cmcc/todo-plain ## Basic Information - **Project Name**: todo-plain - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-21 - **Last Updated**: 2026-05-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Todo Plain — 无框架 Python Web 应用 仅依赖 pymysql 的极简 Todo 管理应用,其余均为 Python 标准库。 ## 项目对比 | 版本 | 技术栈 | 依赖数量 | |------|--------|----------| | `todo-fastapi` | FastAPI + SQLAlchemy + PyMySQL + Uvicorn + Pydantic | ~10 | | `todo-django` | Django + DRF + mysqlclient + django-environ + drf-spectacular | ~10 | | **`todo-plain`** | **http.server + MySQL (pymysql)** | **1** | ## 前置条件 - Python 3.13+ - MariaDB / MySQL(本地运行,需有创建数据库的权限) - `pip install pymysql` ## 启动 ```bash cd todo-plain # 首次需创建数据库(或由程序自动创建) python server.py ``` 访问 http://127.0.0.1:8000/ ## REST API | 方法 | 路径 | 说明 | |------|------|------| | GET | /api/todos | 获取列表 | | POST | /api/todos | 创建待办 | | GET | /api/todos/{id} | 获取详情 | | PUT | /api/todos/{id} | 更新(部分更新) | | DELETE | /api/todos/{id} | 删除 | | GET | / | Web 管理页面 | ## 效果图 ![Todo 管理界面](todo-main.png) ## 设计文档 详细架构、请求生命周期、与框架版本的对比分析见 [docs/design.md](docs/design.md)。 ## 配置 通过 `.env` 文件或环境变量: | 变量 | 默认值 | 说明 | |------|--------|------| | DATABASE_URL | mysql+pymysql://todoapp:todoapp123@127.0.0.1:3306/todo_plain | MySQL 连接字符串 | | HOST | 127.0.0.1 | 监听地址 | | PORT | 8000 | 监听端口 | | DEBUG | true | 调试模式(HTTP 日志) |