上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页
摘要: from collections import OrderedDict od = {'c': 1, 'a': 3, 'b': 5} for key, val in od.items(): print(key, val) is_od = {} OrderedDict(is_od) is_od['c'] 阅读全文
posted @ 2020-08-18 09:39 Fmaj-7 阅读(125) 评论(0) 推荐(0)
摘要: pip install setuptools-scm 转自:https://www.cnblogs.com/ruhai/p/11166876.html 阅读全文
posted @ 2020-08-17 16:03 Fmaj-7 阅读(105) 评论(0) 推荐(0)
摘要: 转自:https://www.cnblogs.com/sewen-H/p/13362598.html 阅读全文
posted @ 2020-08-17 10:45 Fmaj-7 阅读(403) 评论(0) 推荐(0)
摘要: 1 def populate(self, installed_apps=None): 2 """ 3 Loads application configurations and models. 4 5 This method imports each application module and th 阅读全文
posted @ 2020-08-17 10:10 Fmaj-7 阅读(161) 评论(0) 推荐(0)
摘要: yum -y install epel-releaseyum -y install python-pip 阅读全文
posted @ 2020-08-15 12:01 Fmaj-7 阅读(126) 评论(0) 推荐(0)
摘要: 1、备份 mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、下载到/etc/yum.repos.d wget -O /etc/yum.repos.d/CentOS-Base.repo htt 阅读全文
posted @ 2020-08-15 11:39 Fmaj-7 阅读(1424) 评论(0) 推荐(0)
摘要: 转自:https://blog.51cto.com/5001660/2097212 阅读全文
posted @ 2020-08-14 09:13 Fmaj-7 阅读(151) 评论(0) 推荐(0)
摘要: 1 class ModelFormUploadFile(models.Model): 2 '''ModelForm测试上传文件''' 3 name = models.FileField(upload_to=settings.MEDIA_ROOT) 4 5 class Meta: 6 db_table 阅读全文
posted @ 2020-08-11 17:06 Fmaj-7 阅读(572) 评论(0) 推荐(0)
摘要: 1 方法一: 2 id_list = [1, 2, 3, 4] 3 TestModel.objects.filter(id__in=id_list) 4 方法二: 5 from django.db.models import Q 6 sql = Q() 7 for id in id_list: 8 阅读全文
posted @ 2020-08-07 23:01 Fmaj-7 阅读(220) 评论(0) 推荐(0)
摘要: 1 mixin.py 2 from django.contrib.auth.decorators import login_required 3 4 class LoginRequireMixin(object): 5 '''登录装饰''' 6 @classmethod 7 def as_view( 阅读全文
posted @ 2020-08-07 09:23 Fmaj-7 阅读(158) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 18 下一页