摘要: 将大佬的博客整理成相关目录。查找方便 go语言安装及介绍 go语言环境搭建 go语言基础之变量和常量 go语言基础之基本数据类型 go语言基础之运算符 go语言基础之流程控制 Go语言fmt.Printf使用指南 Go语言基础之数组 Go语言基础之切片 Go语言基础之map Go语言基础之函数 Go 阅读全文
posted @ 2023-02-03 11:55 前方、有光 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 九月份开始,半年内搞定运维,博客会慢慢的更新,vim编辑器,Nginx配置文件优化,Linux命名 运维基础 运维基础-Linux发展史、安装、基本操作 运维基础-用户和组管理 运维基础-文件权限管理 运维基础-进程管理 运维基础-IO 管道 运维基础-查找压缩 系统管理 系统管理-网络管理 系统管 阅读全文
posted @ 2018-08-21 10:02 前方、有光 阅读(2004) 评论(2) 推荐(1) 编辑
摘要: 查询目录 一,硬件 十一,数据库 二,Linux基础 十二,前端 三,python基础 十三,Django 四,python文件处理 十四,flask 五,函数 十五,版本控制-Git 六,模块和包 十六,缓存 七,面向对象 十七,爬虫 八,异常处理 十八,项目 九,网络编程 十九,源码解读 十,进 阅读全文
posted @ 2018-01-20 12:04 前方、有光 阅读(6567) 评论(12) 推荐(9) 编辑
摘要: import threading from datetime import datetime from peewee import Model, PostgresqlDatabase, AutoField, DateTimeField from playhouse.shortcuts import 阅读全文
posted @ 2024-01-08 09:53 前方、有光 阅读(4) 评论(0) 推荐(0) 编辑
摘要: import asyncio import aioredis from config.env_config import REDIS_URL class RedisClient: def __init__(self, url, decode_responses=True, max_connectio 阅读全文
posted @ 2023-12-25 19:49 前方、有光 阅读(5) 评论(0) 推荐(0) 编辑
摘要: 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 前方、有光 阅读(7) 评论(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:15 前方、有光 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 目前就想到了这两种 drf框架返回接口数据的时候返回count接口数据随着数据的增多查询缓慢! 1. 不返回总数据,前端采用下拉刷新方式获取 2. 主键采用int类型,每次返回最后一条数据id数即为总数(first().id - last().id + 1) from collections imp 阅读全文
posted @ 2023-05-29 17:37 前方、有光 阅读(52) 评论(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:59 前方、有光 阅读(336) 评论(1) 推荐(0) 编辑
摘要: 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:09 前方、有光 阅读(131) 评论(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 前方、有光 阅读(426) 评论(1) 推荐(0) 编辑
摘要: 起源于一个比较奇葩的需求,默认的celery无法实现: 需要用户输入一个开始时间,结束时间,以及时间间隔,需要在该时间段内指定间隔执行 import datetime def task(start: datetime.datetime, end: datetime.datetime, interva 阅读全文
posted @ 2023-04-20 18:21 前方、有光 阅读(111) 评论(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 前方、有光 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 1. 新增middleware.py中间件: 需要在setting.py注册 class LoggingMiddleware: """ 日志记录模块: 操作用户、操作ip、请求路径、请求方式、请求时间 """ def __init__(self, get_response): self.get_re 阅读全文
posted @ 2023-04-07 15:13 前方、有光 阅读(517) 评论(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 前方、有光 阅读(144) 评论(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 前方、有光 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 33MEHOB8W0-eyJsaWNlbnNlSWQiOiIzM01FSE9COFcwIiwibGljZW5zZWVOYW1lIjoiUG9saXRla25payBNZXJsaW1hdSBNZWxha2EiLCJhc3NpZ25lZU5hbWUiOiJtYWdnaWUgc2VyIiwiYXNzaWd 阅读全文
posted @ 2023-03-28 17:40 前方、有光 阅读(99) 评论(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 前方、有光 阅读(51) 评论(0) 推荐(0) 编辑