上一页 1 2 3 4 5 6 ··· 33 下一页
摘要: package main import "fmt" const ( defaultName string = "张建平" defaultAge int = 27 defaultHigh int = 175 ) type User struct { Name string Age int High i 阅读全文
posted @ 2023-06-29 22:58 前方、有光 阅读(45) 评论(0) 推荐(0)
摘要: version: "3" services: halo: image: halohub/halo:2.6 container_name: halo restart: on-failure:3 depends_on: halodb: condition: service_healthy network 阅读全文
posted @ 2023-06-08 18:14 前方、有光 阅读(36) 评论(0) 推荐(0)
摘要: 目前就想到了这两种 drf框架返回接口数据的时候返回count接口数据随着数据的增多查询缓慢! 1. 不返回总数据,前端采用下拉刷新方式获取 2. 主键采用int类型,每次返回最后一条数据id数即为总数(first().id - last().id + 1) from collections imp 阅读全文
posted @ 2023-05-29 17:37 前方、有光 阅读(130) 评论(2) 推荐(0)
摘要: import cv2 from func_timeout import func_set_timeout, exceptions def check_rtsp_stream(url): @func_set_timeout(2) def parse_rtsp_stream(rtsp_address): 阅读全文
posted @ 2023-04-28 14:58 前方、有光 阅读(612) 评论(3) 推荐(1)
摘要: import os import re import netifaces import subprocess class NetWorkConfig: def __init__(self): pass @staticmethod def check_network_isvalid(ip, netma 阅读全文
posted @ 2023-04-25 14:08 前方、有光 阅读(262) 评论(0) 推荐(0)
摘要: 效果图↓ 需要配置↓ index.html↓ <!DOCTYPE html> {% load i18n static %} {% load simpletags %} {% load customtags %} {% get_current_language as LANGUAGE_CODE %}{ 阅读全文
posted @ 2023-04-25 09:51 前方、有光 阅读(686) 评论(1) 推荐(0)
摘要: 起源于一个比较奇葩的需求,默认的celery无法实现: 需要用户输入一个开始时间,结束时间,以及时间间隔,需要在该时间段内指定间隔执行 import datetime def task(start: datetime.datetime, end: datetime.datetime, interva 阅读全文
posted @ 2023-04-20 18:21 前方、有光 阅读(164) 评论(0) 推荐(0)
摘要: from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import mode 阅读全文
posted @ 2023-04-07 15:38 前方、有光 阅读(77) 评论(0) 推荐(0)
摘要: 1. 新增middleware.py中间件: 需要在setting.py注册 class LoggingMiddleware: """ 日志记录模块: 操作用户、操作ip、请求路径、请求方式、请求时间 """ def __init__(self, get_response): self.get_re 阅读全文
posted @ 2023-04-07 15:13 前方、有光 阅读(695) 评论(0) 推荐(0)
摘要: import socket def get_local_ip(): """ 获取本机 IP 地址: 通用 """ try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('8.8.8.8', 80)) ip = s.g 阅读全文
posted @ 2023-04-04 14:38 前方、有光 阅读(201) 评论(0) 推荐(0)
摘要: 1. 创建middleware.py class InternalIPMiddleware: def __init__(self, get_response): self.get_response = get_response def __call__(self, request): # 获取请求头 阅读全文
posted @ 2023-04-04 14:37 前方、有光 阅读(75) 评论(0) 推荐(0)
摘要: 33MEHOB8W0-eyJsaWNlbnNlSWQiOiIzM01FSE9COFcwIiwibGljZW5zZWVOYW1lIjoiUG9saXRla25payBNZXJsaW1hdSBNZWxha2EiLCJhc3NpZ25lZU5hbWUiOiJtYWdnaWUgc2VyIiwiYXNzaWd 阅读全文
posted @ 2023-03-28 17:39 前方、有光 阅读(2092) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- """ @author: Mr_zhang @software: PyCharm @file: encryption.py @time: 2023/3/23 10:00 """ import json import time import base64 阅读全文
posted @ 2023-03-23 15:04 前方、有光 阅读(90) 评论(0) 推荐(0)
摘要: 网络继电器配置如下: 1. 搜索局域网网络设备 2. 参数配置&写入配置 这里网络继电器作为服务端。客户端通过socket建立链接并发送开关指令(socket对接即可。mqtt根据需求配置(高版本mqtt协议不支持))) import socket def open_door(rely_host=" 阅读全文
posted @ 2023-03-22 15:00 前方、有光 阅读(568) 评论(1) 推荐(0)
摘要: 将大佬的博客整理成相关目录。查找方便 go语言安装及介绍 go语言环境搭建 go语言基础之变量和常量 go语言基础之基本数据类型 go语言基础之运算符 go语言基础之流程控制 Go语言fmt.Printf使用指南 Go语言基础之数组 Go语言基础之切片 Go语言基础之map Go语言基础之函数 Go 阅读全文
posted @ 2023-02-03 11:55 前方、有光 阅读(161) 评论(0) 推荐(1)
上一页 1 2 3 4 5 6 ··· 33 下一页