会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
是阿杰呀
study hungry,study foolish.
首页
新随笔
联系
管理
2024年1月18日
【Python】datetime 时区转换, celery 结果 date_done比东八区晚8小时
摘要: 1. 通过 AsyncResult获取任务结果对象 from celery.result import AsyncResult import pytz from datetime import datetime # 根据任务ID获取任务结果对象 result = AsyncResult(task_i
阅读全文
posted @ 2024-01-18 14:42 是阿杰呀
阅读(153)
评论(0)
推荐(0)
2024年1月2日
【Linux】用Xshell通过SSH连接ubuntu报错“服务器发送了一个意外的数据包”
摘要: 安装了Ubuntu20.04, 安装了ssh:sudo apt-get install ssh 想用Xshell通过SSH连接,结果报错:“服务器发送了一个意外的数据包”,如下图所示: ①在/etc/ssh/sshd_config配置文件最后面添加下面一行: KexAlgorithms curve2
阅读全文
posted @ 2024-01-02 09:40 是阿杰呀
阅读(639)
评论(0)
推荐(0)
2023年12月21日
【Django】加密 settings.py文件中的数据库密码
摘要: 1. 使用 from cryptography.fernet import Fernet 第三方库 pip3 install cryptography 2. Fernet的使用 from cryptography.fernet import Fernet # 生成加密密钥 key = Fernet.
阅读全文
posted @ 2023-12-21 12:24 是阿杰呀
阅读(385)
评论(0)
推荐(0)
2023年12月19日
【Python】python re模块判断密码的条件
摘要: 判断密码长度最少8位, 且应为数字、字母和特殊符号中至少2类的组合 import re def check_password_func(password): # 长度至少为8位,且应为数字、字母和特殊符号中至少2类的组合 match1 = bool(re.search(r'\d+', passwor
阅读全文
posted @ 2023-12-19 16:19 是阿杰呀
阅读(48)
评论(0)
推荐(0)
2023年11月23日
【Python】 多层级嵌套循环
摘要: 1. 渲染多级菜单, 并调整数据 # 生成 菜单树状目录 class MenuTreeView(APIView): # 多层级 生成树状目录 def generate_menu_tree(self, parent_menu): temp_menu_list = [] sub_menus = mode
阅读全文
posted @ 2023-11-23 17:38 是阿杰呀
阅读(66)
评论(0)
推荐(0)
2023年11月22日
【Python】linux下 安装 matplotlib SimHei字体
摘要: 转载地址 https://blog.csdn.net/ProceduralMan/article/details/128682590
阅读全文
posted @ 2023-11-22 16:29 是阿杰呀
阅读(306)
评论(0)
推荐(0)
2023年11月21日
【Python】pandas 读取 后向轨迹文件
摘要: import pandas as pd from pathlib import Path def backwardtrace(file: str): if not Path(file).is_file(): raise ValueError('File does not exist!') else:
阅读全文
posted @ 2023-11-21 14:59 是阿杰呀
阅读(36)
评论(0)
推荐(0)
【Python】geopandas 读取 shp/geojson 边界文件
摘要: 1. 读取 shp/geojson 边界文件 import geopandas as gpd file = 'media/abc.geojson' gdf = gpd.read_file(file) # 将 GeoDataFrame 转换为 GeoJSON 字符串 geojson = json.lo
阅读全文
posted @ 2023-11-21 14:57 是阿杰呀
阅读(1073)
评论(0)
推荐(0)
2023年10月30日
【Python】在linux环境下, Django 3.0+版本遇到的一些问题
摘要: 1. Django3.2版本升级后的一些报错, 导致项目运行失败 1.1 site-packages/rest_framework/serializers.py from django.db.models.fields import FieldDoesNotExist ImportError: ca
阅读全文
posted @ 2023-10-30 10:52 是阿杰呀
阅读(104)
评论(0)
推荐(0)
【Linux】文件可执行权限
摘要: 文件可执行权限 读(4)、写(2)和执行(1)的权限 chmod 755 file_name
阅读全文
posted @ 2023-10-30 10:32 是阿杰呀
阅读(64)
评论(0)
推荐(0)
下一页