diff --git a/config/urls.py b/config/urls.py index 15c6516..0c9e1bc 100644 --- a/config/urls.py +++ b/config/urls.py @@ -15,6 +15,8 @@ from rest_framework_simplejwt.views import ( TokenRefreshView, ) +from device_management.views import home_page + schema_view = get_schema_view( openapi.Info( title="视频主设备管理系统 API", @@ -29,6 +31,7 @@ schema_view = get_schema_view( ) urlpatterns = [ + path('', home_page, name='home'), path('admin/', admin.site.urls), path('api/', include('device_management.urls')), path('api/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'), diff --git a/device_management/templates/device_management/index.html b/device_management/templates/device_management/index.html new file mode 100644 index 0000000..4e1ec9a --- /dev/null +++ b/device_management/templates/device_management/index.html @@ -0,0 +1,249 @@ + + + + + + 视频主设备管理系统 + + + + + +
+
+
+
+
+ + + +
+
+

视频主设备管理系统

+

Device Management System · RESTful API Service

+
+
+
+ + 服务运行中 +
+
+
+
+ + +
+ +
+
+
+
+ + + +
+ 核心 +
+

设备管理

+

全生命周期设备资产库

+
+ +
+
+
+ + + +
+ 网络 +
+

IP/序列号管理

+

唯一性校验防止冲突

+
+ +
+
+
+ + + + +
+ 运维 +
+

维修/巡检追踪

+

历史可追溯保修预警

+
+ +
+
+
+ + + +
+ 数据 +
+

Excel导入导出

+

批量数据高效管理

+
+
+ + +
+

快捷入口

+ +
+ + +
+ +
+

+ + 技术栈 +

+
+
+ 后端框架 + Django 4.2 + DRF 3.15 +
+
+ 身份认证 + JWT Token + Session +
+
+ 图片处理 + Pillow (自动缩略图) +
+
+ Excel处理 + openpyxl + pandas +
+
+ 日志系统 + loguru +
+
+
+ + +
+

+ + API 端点 +

+
+
+ GET + /api/devices/ + 设备列表 +
+
+ POST + /api/devices/ + 创建设备 +
+
+ GET + /api/devices/{id}/ + 设备详情 +
+
+ GET + /api/devices/export_excel/ + 导出Excel +
+
+ POST + /api/devices/import_excel/ + 导入Excel +
+
+ POST + /api/token/ + JWT认证 +
+
+
+
+
+ + + + + diff --git a/device_management/views.py b/device_management/views.py index 9be157e..5443640 100644 --- a/device_management/views.py +++ b/device_management/views.py @@ -1,7 +1,7 @@ import os from datetime import date +from django.shortcuts import get_object_or_404, render from django.http import HttpResponse -from django.shortcuts import get_object_or_404 from django_filters import rest_framework as filters from rest_framework import viewsets, status, parsers, renderers from rest_framework.decorators import action, api_view, parser_classes @@ -12,6 +12,10 @@ from openpyxl.styles import Font import pandas as pd from loguru import logger + +def home_page(request): + return render(request, 'device_management/index.html') + from .models import ( Device, DeviceSerial, DeviceIP, MaintenanceRecord, DeviceAttachment )