摘要: CSS选择器Beautiful Soup支持大部分的CSS选择器 ,在 Tag 或 BeautifulSoup 对象的 .select() 方法中传入字符串参数,即可使用CSS选择器的语法找到tag:soup.select("title") p:nth-child(2) 选择属于其父元素的第二个<p 阅读全文
posted @ 2016-10-06 21:56 十年闷油瓶 阅读(181) 评论(0) 推荐(0) 编辑
摘要: .sjb-box-slider { width: 238px; height: 58px; overflow: hidden; position: relative } .sjb-box-slider .piclink { width: 238px; height: 58px; position: absolute; left: 0; top: 0; display: bl... 阅读全文
posted @ 2016-09-18 06:26 十年闷油瓶 阅读(906) 评论(0) 推荐(0) 编辑
摘要: #coding:utf-8 #pagenum_count 总页数,pageshow_num 当前显示页 ,pagenum_step 一次最多显示几页 def showpagestr(pagenum_count,pageshow_num,pagenum_step): retstr = '' if pagenum_count == 1: return retstr ... 阅读全文
posted @ 2016-09-12 21:14 十年闷油瓶 阅读(172) 评论(0) 推荐(0) 编辑
摘要: http://xiaorui.cc/2016/05/10/%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90multiprocessing%E7%9A%84value-array%E5%85%B1%E4%BA%AB%E5%86%85%E5%AD%98%E5%8E%9F%E7%9 阅读全文
posted @ 2016-06-07 20:17 十年闷油瓶 阅读(295) 评论(0) 推荐(0) 编辑
摘要: # # This module shows how to use arbitrary callables with a subclass of # `BaseManager`. # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # from multiprocessing import freeze_support fr... 阅读全文
posted @ 2016-06-05 16:18 十年闷油瓶 阅读(412) 评论(0) 推荐(0) 编辑
摘要: import collections from math import ceil from django.utils import six class InvalidPage(Exception): pass class PageNotAnInteger(InvalidPage): pass class EmptyPage(InvalidPage): pas... 阅读全文
posted @ 2016-05-25 06:07 十年闷油瓶 阅读(256) 评论(0) 推荐(1) 编辑
摘要: """ Cross Site Request Forgery Middleware. This module provides a middleware that implements protection against request forgeries from other sites. """ from __future__ import unicode_literals impo... 阅读全文
posted @ 2016-05-24 20:32 十年闷油瓶 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 我还针对这个问题请教了 @c4605 , 他对防御 CSRF 提出了两种解决方案: 在每个表单中包含一个 CSRF Token.不将用于认证的 Token 或 Seesion ID 储存在 Cookie 中,而是将其储存在 localStorage 中,在每次发起请求时手动将 Token 添加到请求 阅读全文
posted @ 2016-05-24 08:30 十年闷油瓶 阅读(121) 评论(0) 推荐(0) 编辑
摘要: (1)add 使用形式为:{{ value | add: "2"}} 意义:将value的值增加2 也可以是字符串拼接(2)upper转换一个字符串为大写形式(3)lower使用形式:{{value | lower}}意义:将一个字符串转换成小写形式(3)capfirst 使用形式为:{{ valu 阅读全文
posted @ 2016-05-01 21:06 十年闷油瓶 阅读(168) 评论(0) 推荐(0) 编辑
摘要: D:\workspace\template1\template1\settings.pyD:\workspace\template1\template1D:\workspace\template1 from django.template import Template, Context 如果使用的 阅读全文
posted @ 2016-04-25 20:28 十年闷油瓶 阅读(342) 评论(0) 推荐(0) 编辑