07 2017 档案

摘要:concurrent.futures模块的基础是Exectuor,Executor是一个抽象类,它不能被直接使用。但是它提供的两个子类ThreadPoolExecutor和ProcessPoolExecutor却是非常有用,顾名思义两者分别被用来创建线程池和进程池的代码。 如果你依然在坚守Pytho 阅读全文
posted @ 2017-07-29 23:55 shy车队破风手
摘要:from django.shortcuts import render, redirect,HttpResponse from app01 import models from rbac.service import initial_permission import datetime import 阅读全文
posted @ 2017-07-26 19:55 shy车队破风手 阅读(151) 评论(0) 推荐(0)
摘要:1. Agent方式(适用于多台机器) API:Django接收数据并入库 程序:放置在每台服务器 服务端(api) from django.shortcuts import render,HttpResponse def asset(request): if request.method == " 阅读全文
posted @ 2017-07-26 19:52 shy车队破风手
摘要:<div> <div><span class="glyphicon glyphicon-search" aria-hidden="true"></span> 搜索条件</div> <div class="condition"> 大分类: {% if kwargs.article_type_id == 阅读全文
posted @ 2017-07-23 14:33 shy车队破风手 阅读(219) 评论(0) 推荐(0)
摘要:KindEditor 防止xss注入: content = """ <p id='i1' a='123' b='999'> <script>alert(123)</script> </p> <p id='i2'> <div> <p>asdfasdf</p> </div> <img id='i3' s 阅读全文
posted @ 2017-07-20 00:09 shy车队破风手 阅读(176) 评论(0) 推荐(0)
摘要:需要导入字体插件: from PIL import Image,ImageDraw,ImageFont,ImageFilter import random def rd_check_code(width=120, height=30, char_length=5, font_file='kumo.t 阅读全文
posted @ 2017-07-19 19:50 shy车队破风手 阅读(317) 评论(0) 推荐(0)
摘要:<div class="art_info clearfix"> <div class="left up_down"> <div class="up" onclick="info_post(this)"> <div><i class="fa fa-thumbs-up" aria-hidden="tru 阅读全文
posted @ 2017-07-19 19:37 shy车队破风手 阅读(217) 评论(0) 推荐(1)
摘要:基本应用 三种传递csrf的方法,一表单提交,二ajax提交,三ajax提交隐藏的csrf input标签中的值 csrf禁用 添加csrf装饰器: 阅读全文
posted @ 2017-07-02 22:37 shy车队破风手 阅读(236) 评论(0) 推荐(0)
摘要:M2M自关联特性: FK自关联: 中间件 - 应用:对所有请求或一部分请求做批量处理 中间件的分类和执行顺序: process_request 如果有返回值,1.10版本以后就从当前中间件执行process_response,1.10版本以前,从最后一个中间件执行process_response p 阅读全文
posted @ 2017-07-02 22:02 shy车队破风手 阅读(206) 评论(0) 推荐(0)