摘要: 测试代码:import timefrom flask.ext.cache import Cachefrom flask import Flaskapp = Flask(__name__)app.config['CACHE_TYPE'] = 'simple'app.cache = Cache(app)... 阅读全文
posted @ 2015-03-03 18:16 blue_whale 阅读(577) 评论(0) 推荐(0) 编辑
摘要: import sys reload(sys) sys.setdefaultencoding('utf8') 阅读全文
posted @ 2014-10-22 20:37 blue_whale 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 如果邮件格式是文本格式,使用“\r\n” 如果件是HTML格式,使用"" 阅读全文
posted @ 2014-10-22 20:35 blue_whale 阅读(4625) 评论(0) 推荐(0) 编辑
摘要: 1. linux查看文件指定多行sed -n 'm,np' filesed -n 'm1p;m2p;m3p' file2. 将命令输出保存到变量中 var=$(ls) echo $var3. 根据时区和时间戳打印日期endtime=$(TZ='America/Los_Angeles' date -... 阅读全文
posted @ 2014-10-10 20:01 blue_whale 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 原文地址:http://stackoverflow.com/questions/7335780/how-to-post-a-django-form-with-ajax-jqueryhtml:view: if request.is_ajax() and request.method == "POST": form = TestForm(request.POST, instance=test) if form.is_valid(): form.save() results[ 'status' ] =True ... 阅读全文
posted @ 2013-12-09 15:54 blue_whale 阅读(318) 评论(0) 推荐(0) 编辑
摘要: [root@localhost setuptools-1.0]# /usr/local/python27/bin/easy_install virtualenvSearching for virtualenvReading https://pypi.python.org/simple/virtualenv/Download error on https://pypi.python.org/simple/virtualenv/: unknown url type: https -- Some packages may not be found!Couldn't find index pa 阅读全文
posted @ 2013-09-30 13:47 blue_whale 阅读(4584) 评论(0) 推荐(0) 编辑