随笔分类 -  笔记

摘要:windows ping 带时间戳 </h1> <div class="clear"></div> <div class="postBody"> <div id="cnblogs_post_description" style="display: none"> windows ping 时间戳 </ 阅读全文
posted @ 2021-04-29 08:25 去遇见最好的自己 阅读(746) 评论(0) 推荐(0)
摘要:修改接口trunk为access模式有2种方式: 第一种: 直接清除此接口的配置,重新设置 clear con int g0/0/0 第二种: [Huawei]int g0/0/3 [Huawei-GigabitEthernet0/0/3]undo port trunk allow-pass vla 阅读全文
posted @ 2021-04-27 14:19 去遇见最好的自己 阅读(2960) 评论(0) 推荐(0)
摘要:![](https://img2020.cnblogs.com/blog/1087691/202104/1087691-20210427131251174-326756671.png) 阅读全文
posted @ 2021-04-27 13:13 去遇见最好的自己 阅读(579) 评论(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 去遇见最好的自己 阅读(1118) 评论(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 去遇见最好的自己 阅读(2090) 评论(0) 推荐(0)
摘要:# 封装 # 对外部隐藏具体的实现细节, 只提供简单的调用接口, 如USB接口 # 在类中, 用双下划线, 封装属性或方法, 外部不能调用, 不能继承 # 例: def __test(self): # 私有方法 pass __name = 'lee' # 私有属性 # 继承 # 将一些共同代码抽取成 阅读全文
posted @ 2019-12-15 13:58 去遇见最好的自己 阅读(124) 评论(0) 推荐(0)
摘要:global 定义一个或多个全局变量 globals() 存储所有全局变量 locals() 存储当前局部区域内,所有局部变量及方法 nonlocal 定义一个在闭包函数内,内部函数引用外部函数的属性 def outer(): n = 1 def inner(): nonlocal n n=2 pr 阅读全文
posted @ 2019-12-06 09:50 去遇见最好的自己 阅读(176) 评论(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 去遇见最好的自己 阅读(159) 评论(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 去遇见最好的自己 阅读(213) 评论(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 去遇见最好的自己 阅读(191) 评论(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 去遇见最好的自己 阅读(846) 评论(0) 推荐(0)
摘要:# 在ORM中设置自关联字段 class Comment(models.Model): user = models.ForeignKey(to='UserInfo') article = models.ForeignKey(to='Article') content = models.CharFie 阅读全文
posted @ 2019-11-17 22:59 去遇见最好的自己 阅读(491) 评论(0) 推荐(0)
摘要:# 修改settings.py DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'test', 'HOST':'127.0.0.1', 'PORT':3306, 'USER':'root', 'PASS 阅读全文
posted @ 2019-11-17 21:22 去遇见最好的自己 阅读(3170) 评论(0) 推荐(1)
摘要:深浅拷贝 深浅copy 先问问大家,什么是拷贝?拷贝是音译的词,其实他是从copy这个英文单词音译过来的,那什么是copy? copy其实就是复制一份,也就是所谓的抄一份。深浅copy其实就是完全复制一份,和部分复制一份的意思。 1,先看赋值运算。 l1 = [1,2,3,['jason','ego 阅读全文
posted @ 2019-11-09 10:53 去遇见最好的自己 阅读(136) 评论(0) 推荐(0)
摘要:# 第一种 res_list = [ {'cat_id':1,'name':'北京','parent_id':0}, {'cat_id':2,'name':'杭州','parent_id':0}, {'cat_id':3,'name':'海淀区','parent_id':1}, {'cat_id': 阅读全文
posted @ 2019-11-07 22:08 去遇见最好的自己 阅读(388) 评论(0) 推荐(0)
摘要:# 导出项目的所有依赖库 pip3 freeze > requirements.txt # 安装项目的所有依赖库 pip install -r requirements.txt 阅读全文
posted @ 2019-11-07 15:43 去遇见最好的自己 阅读(622) 评论(0) 推荐(0)
摘要:from Crypto.Cipher import AES 在python中要使用到crypto相关的库,但是网上的解决方法一大片,能用的没有几个,而且能安装的没有几个,首先我告诉大家为什么不能安装,其次告诉一种真正的方法。 pycrypto,pycrytodome和crypto是一个东西,cryp 阅读全文
posted @ 2019-11-07 07:17 去遇见最好的自己 阅读(42866) 评论(1) 推荐(8)
摘要:# Django中Redis使用配置 CACHES = { 'default':{ 'BACKEND':'django_redis.cache.RedisCache', 'LOCATION':'redis://127.0.0.1:6379', "OPTIONS":{ "CLIENT_CLASS":' 阅读全文
posted @ 2019-11-06 20:11 去遇见最好的自己 阅读(543) 评论(0) 推荐(0)
摘要:转自:https://www.cnblogs.com/bbbbbd/p/7725030.html 错误详情: auth.User.groups: (fields.E304) Reverse accessor for ‘User.groups’ clashes with reverse accesso 阅读全文
posted @ 2019-10-23 20:17 去遇见最好的自己 阅读(200) 评论(0) 推荐(0)
摘要:"def index(request): t = [] for i in range(10000): t.append(models.Book(title=""第%s本书""%(i))) models.Book.objects.bulk_create(t)" 阅读全文
posted @ 2019-10-17 07:59 去遇见最好的自己 阅读(914) 评论(0) 推荐(0)