This commit is contained in:
2025-12-13 15:41:17 +08:00
parent 2d0691153d
commit 00b52253a8
149 changed files with 164 additions and 128745 deletions

View File

@@ -6,7 +6,7 @@
- `Python 3.10+`(建议 3.12.3
- 操作系统Windows
- redis本地 `Redis` 服务(默认地址 `redis://127.0.0.1:6379`
- redisredis版本建议用5.0.10(默认地址 `redis://127.0.0.1:6379`
@@ -24,25 +24,15 @@ python get_machine_code.py
## 三、下载需要的app库
## 三、初始化配置
### 1单独获取库例如需要yolo模块库
### 1双击运行init_backend.bat
```bash
pip install hertz-studio-django-yolo -i https://hertz:hertz@hzpypi.hzsystems.cn/simple/
```
### 2下载全部库
pip install -r requirements.txt -i https://hzpypi.hzsystems.cn/simple/
注:此操作会自动创建环境并下载依赖以及完成数据集迁移
所有库都在requirements.txt的最下面
## 四、配置django
## 四、配置Django
### 1将下载的app注册到django项目中
@@ -71,17 +61,15 @@ path('api/xxx/', include('hertz_studio_django_xxx.urls')),
## **五、启动服务**
- 通过脚本启动(支持端口参数):
- `python start_server.py --port 8000`
- 访问地址:
- `http://127.0.0.1:8000/`
- WebSocket`ws://127.0.0.1:8000/ws/`
- 首次启动将自动执行:
- 扫描并注册新应用到 `INSTALLED_APPS``urls.py``start_server.py:173``start_server.py:98`)。
- 执行 `makemigrations``migrate``start_server.py:1109`)。
- 初始化超级管理员/部门/菜单/角色等(`start_server.py:877`)。
- 创建菜单生成器工具 `generate_menu.py``start_server.py:780`)。
- 启动 `daphne` 并开启热重启监听(`start_server.py:1016``start_server.py:1063`)。
- 通过python脚本启动(支持端口参数):
```python
python start_server.py --port 8000
```
- 通过bat脚本启动快捷
双击 start_server.bat