Files
hertz_django/docs/项目简介.md
2025-11-17 16:39:30 +08:00

53 lines
2.9 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.

# Hertz Studio 后端
## **一、系统简介**
- 统一后端服务,提供 `REST API``WebSocket`,面向 AI 工作室与通用后台场景。
- 模块化设计覆盖认证与权限、通知公告、日志、知识库、系统监控、AI 对话、代码生成、Sklearn 推理、YOLO 目标检测等。
- 基于 `ASGI` 架构,使用 `Daphne` 运行;默认使用 `SQLite`,可切换 `MySQL`;缓存与消息通道使用 `Redis`
- 自动化启动脚本 `start_server.py` 支持数据库迁移与初始数据(菜单、角色、超级管理员)初始化,以及热重启文件监听。
## 二、**体验账户**
- 管理员
账号hertz 密码hertz
- 普通用户
账号demo 密码123456
## 三、**技术栈**
- 后端框架:`Django 5``Django REST Framework``Channels` + `Daphne`
- 数据与缓存:`SQLite`(默认)/ `MySQL`(可选)、`Redis`缓存、会话、Channel Layer
- API 文档:`drf-spectacular` 自动生成,提供 Swagger 与 Redoc 页面。
- 认证与安全:自定义 `AuthMiddleware` + `JWT``pyjwt``CORS` 支持。
- AI / ML`Ultralytics YOLO``OpenCV``NumPy``Scikit-learn``Joblib`,以及本地 `Ollama` 对话集成。
- 工具与其他:`Mako` 模板(代码生成)、`Pillow``watchdog``psutil``GPUtil`
## **四、功能**
- 认证与权限(`hertz_studio_django_auth`
- 用户注册/登录/登出、密码管理、用户信息维护。
- `JWT` 发放与刷新,角色/菜单权限体系,接口权限由 `AuthMiddleware` 统一控制。
- 图形验证码(`hertz_studio_django_captcha`
- 可配置验证码生成与校验、尺寸/颜色/噪声等参数支持。
- 通知公告(`hertz_studio_django_notice`
- 公告 CRUD、状态管理面向工作室信息发布。
- 日志管理(`hertz_studio_django_log`
- 操作日志采集与查询,支持接口级日志记录装饰器。
- 知识库(`hertz_studio_django_wiki`
- 文章与分类管理,面向知识内容沉淀与检索。
- 系统监控(`hertz_studio_django_system_monitor`
- CPU/内存/磁盘/GPU 指标采集与展示,基于 `psutil`/`GPUtil`
- AI 对话(`hertz_studio_django_ai`
- 对接本地 `Ollama`,提供对话接口与 `WebSocket` 推送能力。
- 代码生成(`hertz_studio_django_codegen`
- 基于 `Mako` 的 Django 代码与菜单生成器,支持 CLI 生成并同步权限。
- Sklearn/PyTorch 推理(`hertz_studio_django_sklearn`
- 模型上传、元数据解析(特征/输入输出模式)、统一预测接口,支持 `predict_proba`
- YOLO 目标检测(`hertz_studio_django_yolo`
- 模型管理与启用切换、检测接口、结果中文别名标注与图像绘制;默认模型位于 `static/models/yolov12/weights/best.pt`
- Demo 与首页(`hertz_demo`
- 示例页面验证码、邮件、WebSocket与首页模板 `templates/index.html`