摘要: def replace_utf8mb4(self, v): """Replace 4-byte unicode characters by REPLACEMENT CHARACTER""" import re INVALID_UTF8_RE = re.compile(u'[^\u0000-\uD7FF\uE000-\uFFFF]', re.UNICODE) INVALID_UTF8_RE.sub(u'\uFFFD', v) 阅读全文
posted @ 2013-12-26 14:51 smallcode 阅读(1210) 评论(0) 推荐(0) 编辑
摘要: 不要直接用pip安装,因为会有编译错误。请下载下面的exe安装包:https://pypi.python.org/pypi/MySQL-python 阅读全文
posted @ 2013-12-06 14:03 smallcode 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 1.用Pycharm将项目check out 到本地【Quick Start】->Check out from Version Control->Git,并打开项目2.在【VCS】菜单中选择【Git】->【Rebase my Github fork】3.在【VCS】菜单中选择【Git】->【Push】 阅读全文
posted @ 2013-12-02 13:49 smallcode 阅读(1646) 评论(0) 推荐(0) 编辑
摘要: 参考:http://stackoverflow.com/questions/17972347/error-command-gcc-failed-no-such-file-or-directory解决方案:安装:gccwinbinaries 地址:https://github.com/develersrl/gccwinbinaries 阅读全文
posted @ 2013-10-15 18:29 smallcode 阅读(2447) 评论(0) 推荐(0) 编辑
摘要: 方案:需要在settings.py的ALLOWED_HOSTS参数中添加域名:如:ALLOWED_HOSTS=['*']#允许所有域名访问ALLOWED_HOSTS=['localhost']#允许本地访问参考:http://stackoverflow.com/questions/15128135/django-setting-debug-false-causes-500-error 阅读全文
posted @ 2013-10-15 15:20 smallcode 阅读(1420) 评论(0) 推荐(0) 编辑
摘要: 方案1:取消CSRF(参见:http://www.cnblogs.com/wenjiashe521/archive/2012/08/29/2662041.html)from django.views.decorators.csrf import csrf_exempt@csrf_exemptdef index(request):方案2:使用render方法(不能使用render_to_response)(参见:http://stackoverflow.com/questions/10388033/csrf-verification-failed-request-aborted)def inde 阅读全文
posted @ 2013-10-15 09:49 smallcode 阅读(440) 评论(0) 推荐(0) 编辑
摘要: 1.到http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml下载并安装lxml2.在cmd中执行:pip install PyQuery 阅读全文
posted @ 2013-10-13 15:29 smallcode 阅读(290) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-21 04:29 smallcode 阅读(12) 评论(0) 推荐(0) 编辑
摘要: <?php$mid='1234567890';echo midToStr($mid);function midToStr($mid) { settype($mid, 'string'); $mid_length = strlen($mid); $url = ''; $str = strrev($mid); $str = str_split($str, 7); foreach ($str as $v) { $char = intTo62(strrev($v)); $char = str_pad($char, 4, "0") 阅读全文
posted @ 2013-05-21 03:03 smallcode 阅读(226) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2013-05-21 02:46 smallcode 阅读(11) 评论(0) 推荐(0) 编辑