mat/CLAUDE.md

27 lines
879 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# mat3 项目指引
## 后端运行环境
后端有独立虚拟环境,路径为 `backend/.venv/`。执行 Django 管理命令、运行 Python 脚本时**必须使用**该虚拟环境的 Python否则会因系统 Python 缺少 `decouple` 等依赖而失败。
**正确用法**(从任意工作目录):
```bash
D:/projects/mat3/backend/.venv/Scripts/python.exe D:/projects/mat3/backend/manage.py <command>
```
示例:
```bash
# 运行 migration
D:/projects/mat3/backend/.venv/Scripts/python.exe D:/projects/mat3/backend/manage.py migrate
# 生成 migration
D:/projects/mat3/backend/.venv/Scripts/python.exe D:/projects/mat3/backend/manage.py makemigrations
# 启动开发服务器
D:/projects/mat3/backend/.venv/Scripts/python.exe D:/projects/mat3/backend/manage.py runserver
```
**不要**直接 `python manage.py ...`——系统 Python 没有项目依赖。