随笔分类 - Python
摘要:arr = [[1,2,3,4],[5,6,7,8],[9,10,11,12]] #方法1ar2 =[]for i in range(len(arr[0])): b =[] for j in range(len(arr)): b.append(arr[j][i]) ar2.append(b)prin
阅读全文
摘要:django 项目配置websocket 1.安装包 channels==3.0.4 channels-redis==3.3.1 2.修改项目配置文件settings.py INSTALLED_APPS = [ 'simpleui', 'corsheaders', 'django.contrib.a
阅读全文
摘要:报错原因 因开发机包含python的多个版本,3.7 3.8 3.9,同时使用了django-redis 包, 缓存公用的一个redis中间件,如果3.8或3.9 向redis写入key 3.7读取的时候就会报错 ValueError: unsupported pickle protocol: 5
阅读全文
摘要:待整理 https://blog.csdn.net/m0_47590417/article/details/119082064
阅读全文
摘要:import openpyxl as xl from copy import copy style_attrs = ["alignment", "border", "fill", "font", "number_format", "protection"] def cells(worksheet):
阅读全文
摘要:https://cloud.tencent.com/developer/article/1743203 https://cloud.tencent.com/developer/article/1518588
阅读全文
摘要:docker-compose 发布Django 项目
阅读全文
摘要:# !/usr/bin/python3 # -*- coding: utf-8 -*- # json 文本文件转化成csv import csv # json数据 import json with open('json.txt', 'r', encoding='UTF-8') as f: rows
阅读全文
摘要:输出到控制台 nginx cd nginx/logs tail -f access.log liunx/docker 修改镜像源 pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ pip config se
阅读全文
摘要:项目本身存在大量并发...点击右上角x,不要犹豫直接go重构 如果没有太多的并发,可以考虑通过uwsgi方式提升项目性能,会提升3-5倍 压测工具 mac自带的ab其实就是ApacheBench工具 常用命令 ab -h Usage: ab [options] [http[s]://]hostnam
阅读全文
摘要:1. 去除list空元素 list(filter(lambda x: x, "a;b;c".split(';')))
阅读全文
摘要:https://python3-cookbook.readthedocs.io/zh_CN/latest/c13/p15_luanch_a_web_browser.html
阅读全文
摘要:背景 项目投产前准备步骤 1.新建虚拟环境 2.安装nginx 配置wsgi 3.启动应用服务器(建议80/443)端口 4.配置web服务器 5.配置域名 django took too long to shut down and was killed 报错 症状: 项目可以正常启动,每次只能处理
阅读全文
摘要:描述待添加 #pip install pycryptodome == 3.9.9 from Crypto.PublicKey import RSA from Crypto.Random import get_random_bytes from Crypto.Cipher import AES, PK
阅读全文
摘要:https://stackoverflow.com/questions/49137695/how-to-get-the-value-of-oid-in-python-using-pysnmp https://stackoverflow.com/questions/53779585/can-pysnm
阅读全文
摘要:1.注意事项 发送邮件已QQ为例 如何开启QQ邮箱smtp 请参照 https://service.mail.qq.com/cgi-bin/help?subtype=1&no=166&id=28 settings.py 配置如下 # SECURITY WARNING: don't run with
阅读全文
摘要:Django settings DEBUG=False 无法加载资源文件
Refused to execute script from '
阅读全文
摘要:1.项目文件中新增 test_settings.py prd_settings.py 2.py文件中区分项目的settings文件 # 判断是否为生产环境 ENV_PROFILE = os.getenv("ENV") if ENV_PROFILE == "test": import OpenTheD
阅读全文
摘要:链接mysql 数据库 orm 常用查询语句
阅读全文

浙公网安备 33010602011771号