上一页 1 2 3 4 5 6 ··· 14 下一页
摘要: 官方文档:https://docs.djangoproject.com/en/1.10/howto/custom-template-tags/#simple-tags stackoverflow demo:http://stackoverflow.com/questions/6451304/djan 阅读全文
posted @ 2016-12-21 11:51 tommy.yu 阅读(277) 评论(0) 推荐(0) 编辑
摘要: django的单元测试 官方文档:https://docs.djangoproject.com/en/dev/topics/testing/ 相对于自己封装urllib/urllib2/request做测试类有以下特点: 1. 独立的测试数据库(与生产库分离,因此更利于测试人员做测试而不影响正式数据 阅读全文
posted @ 2016-12-13 15:52 tommy.yu 阅读(353) 评论(0) 推荐(0) 编辑
摘要: 参考: https://python-programming.courses/recipes/django-require-authentication-pages/ 即通过中间件来做AOP拦截。不用每个函数每个类加修饰器/MixIn。 1. 在某个处理用户相关的模块中添加middleware.py 阅读全文
posted @ 2016-12-12 10:48 tommy.yu 阅读(1139) 评论(0) 推荐(0) 编辑
摘要: https://github.com/docker-library/python/issues/21 例如编译安装python3.5.2,脚本如下: 其中 ./configure --prefix=/usr/local --enable-shared 中的 --enable-shared 很重要。 阅读全文
posted @ 2016-12-08 12:56 tommy.yu 阅读(5913) 评论(0) 推荐(0) 编辑
摘要: 解决方案: http://stackoverflow.com/questions/26256421/sql-load-data-infile-utf8-issue 即: into table xxx 后紧接着指定字符集 character set utf8; /path/to/sqlfile 放在/ 阅读全文
posted @ 2016-12-05 13:59 tommy.yu 阅读(407) 评论(0) 推荐(0) 编辑
摘要: 解决 即: 1. js的对象像 python的字典一样无节操。直接 obj[attr]=value 就可以新增属性。 2. 遍历对象属性 : for(var attr in obj) 即可。 阅读全文
posted @ 2016-12-02 10:47 tommy.yu 阅读(542) 评论(0) 推荐(0) 编辑
摘要: http://stackoverflow.com/questions/38714936/typeerror-str-does-not-support-the-buffer-interface-in-python 下面这样会报错: 修正方案: 即:对于字节流(byte)类型的数据,因此此类bug时,将 阅读全文
posted @ 2016-12-01 17:48 tommy.yu 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 曾经了解过。 放在一边,嫌麻烦。 如今身为leader,站在团队沟通的角度看看,还不错。 有几个优点: 1. api一览表 2. api web预览界面(类似.net的webservice预览界面),可以直接在上面(类似postman的方式)模拟和服务器的通讯。 3. api的配置化,通用性的查增删 阅读全文
posted @ 2016-11-28 11:44 tommy.yu 阅读(536) 评论(0) 推荐(0) 编辑
摘要: 经常用(隔很久)经常忘。 备忘下:http://blog.csdn.net/ithomer/article/details/9288353 阅读全文
posted @ 2016-11-25 14:53 tommy.yu 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 接口测试有人喜欢postman(for windows or mac) 如果长期用linux工作,可能更喜欢命令的方式,比如curl最近深入了解了下django-rest-framwork,他们推荐了一个工具:httpie 安装: python2.x python3.x 然后直接: 一张图说明区别, 阅读全文
posted @ 2016-11-24 11:17 tommy.yu 阅读(979) 评论(0) 推荐(0) 编辑
摘要: nginx默认支持断点续传: 测试方法: 参考:http://www.justwinit.cn/post/7635/ wget断点续传方法: 断点续传。 当文件特别大或者网络特别慢的时候,往往一个文件还没有下载完,连接就已经被切断,此时就需要断点续传。wget的断点续传是自动的,只需要使用-c参数, 阅读全文
posted @ 2016-11-24 09:50 tommy.yu 阅读(747) 评论(0) 推荐(0) 编辑
摘要: https://select2.github.io/examples.html 一大堆的坑: 1. 不同版本之间貌似不兼容,对应版本看对应的文档。 2. 4.0.3版本: 1)。 自定义渲染的option无法选中。谷歌了下,似乎返回的对象必需有 id和text属性, 另外可以加一个属性,指向对象本身 阅读全文
posted @ 2016-11-23 19:24 tommy.yu 阅读(672) 评论(0) 推荐(0) 编辑
摘要: 主机:win7 工具:vmare 11.0.0 系统:http://mirrors.163.com/centos/6.8/isos/x86_64/CentOS-6.8-x86_64-minimal.iso 原因比较简单: 默认的etho0没有启用,启用即可。 将 ONBOOT=no 改为 ONBOO 阅读全文
posted @ 2016-11-23 12:57 tommy.yu 阅读(301) 评论(0) 推荐(0) 编辑
摘要: ubuntu 14.04 碰到了这个莫名其妙的问题。谷歌了一把,解决方案如下:http://askubuntu.com/questions/683857/curl-1-protocol-https-not-supported-or-disabled-in-libcurl 即重新编译安装curl包(l 阅读全文
posted @ 2016-11-15 12:56 tommy.yu 阅读(956) 评论(0) 推荐(0) 编辑
摘要: https://docs.python.org/3/installing/ pip is the preferred installer program. Starting with Python 3.4, it is included by default with the Python bina 阅读全文
posted @ 2016-11-14 10:16 tommy.yu 阅读(198) 评论(0) 推荐(0) 编辑
摘要: askubuntu原回答摘抄如下 阅读全文
posted @ 2016-11-11 14:31 tommy.yu 阅读(1703) 评论(0) 推荐(0) 编辑
摘要: http://shenfeng.me/how-far-epoll-can-push-concurrent-socket-connection.html 阅读全文
posted @ 2016-10-25 18:13 tommy.yu 阅读(320) 评论(0) 推荐(0) 编辑
摘要: MySQL最大连接数 关于最大连接数:http://mg123.lofter.com/post/1a5f3e_996f838 可以通过修改配置文件(默认/etc/my.cnf)中的"mysqld"段的max_connections 参数来支持更多的连接(默认100)。 猜测mysql利用了linux 阅读全文
posted @ 2016-10-24 17:46 tommy.yu 阅读(9558) 评论(1) 推荐(0) 编辑
摘要: portable : http://dl2.xmind.cn/xmind-7.5-update1-portable.zip 阅读全文
posted @ 2016-10-17 11:38 tommy.yu 阅读(369) 评论(0) 推荐(0) 编辑
摘要: 这里有一篇写的不错的:http://www.jianshu.com/p/1840035cb510 自己的“格式化”后的内容备忘下: 我们总在说c10k的问题, 也做了不少优化, 然后优化总是不够的。 其中的一个瓶颈就是一些耗时的操作(网络请求/文件操作--含耗时的数据库操作)。 如果我们不关心他们的 阅读全文
posted @ 2016-10-13 09:51 tommy.yu 阅读(7098) 评论(1) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 14 下一页