摘要: ![](https://img2020.cnblogs.com/blog/1087691/202104/1087691-20210427131251174-326756671.png) 阅读全文
posted @ 2021-04-27 13:13 去遇见最好的自己 阅读(562) 评论(0) 推荐(0) 编辑
摘要: 转载自:https://www.cnblogs.com/dongml/p/10333819.html 很多时候我们都会忘记Linux root 用户的口令,下面就教大家如果忘记root口令怎么办 第1步:开机后在内核上按“e”。截图如下 按e以后会进入内核启动页面,如下图 第2步:在linux16这 阅读全文
posted @ 2020-11-10 17:13 去遇见最好的自己 阅读(653) 评论(0) 推荐(0) 编辑
摘要: 目录结构 配置celery 创建任务 启动woker:celery -A celery_task worker -l info -P eventlet 自动添加任务:celery -A celery_task beat -l info 阅读全文
posted @ 2020-10-29 11:51 去遇见最好的自己 阅读(1101) 评论(0) 推荐(0) 编辑
摘要: from django.db.models.fields import FieldDoesNotExist 错误代码如下: Traceback (most recent call last): File "../../manage.py", line 15, in execute_from_comm 阅读全文
posted @ 2020-10-23 17:20 去遇见最好的自己 阅读(1983) 评论(0) 推荐(0) 编辑
摘要: # 封装 # 对外部隐藏具体的实现细节, 只提供简单的调用接口, 如USB接口 # 在类中, 用双下划线, 封装属性或方法, 外部不能调用, 不能继承 # 例: def __test(self): # 私有方法 pass __name = 'lee' # 私有属性 # 继承 # 将一些共同代码抽取成 阅读全文
posted @ 2019-12-15 13:58 去遇见最好的自己 阅读(118) 评论(0) 推荐(0) 编辑
摘要: global 定义一个或多个全局变量 globals() 存储所有全局变量 locals() 存储当前局部区域内,所有局部变量及方法 nonlocal 定义一个在闭包函数内,内部函数引用外部函数的属性 def outer(): n = 1 def inner(): nonlocal n n=2 pr 阅读全文
posted @ 2019-12-06 09:50 去遇见最好的自己 阅读(166) 评论(0) 推荐(0) 编辑
摘要: # 解压赋值 a,b = (1,2) print(a,b) # 1 2 # 交叉赋值 a = 1 b = 2 a,b = b,a print(a,b) # 2 1 # 按指定条件给字典排序 test = {'a':1,'b':3,'c':2} res = dict(sorted(test.items 阅读全文
posted @ 2019-12-06 09:30 去遇见最好的自己 阅读(153) 评论(0) 推荐(0) 编辑
摘要: # zip 将两个列表,对应位置的值拼接成元组,最后结果是一个列表套元组,注:不对应的值,会被舍弃. l1 = [1,1,3,6,7] l2 = [1,2,3,4] print(list(zip(l1,l2))) # [(1, 1), (2, 2), (3, 3), (6, 4)] # filter 阅读全文
posted @ 2019-12-04 15:26 去遇见最好的自己 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 修改头像 ajax上传图片,必须创建FormDate(),然后把图片加进去. ajax上传图片 $('#id_set_avatar_submit').click(function () { avatar_img = $('#id_avatar')[0].files[0]; var formData 阅读全文
posted @ 2019-11-19 21:55 去遇见最好的自己 阅读(182) 评论(0) 推荐(0) 编辑
摘要: from django.db import models from django.contrib.auth.models import AbstractUser # Create your models here. # 用户表 class UserInfo(AbstractUser): phone 阅读全文
posted @ 2019-11-18 21:37 去遇见最好的自己 阅读(808) 评论(0) 推荐(0) 编辑