摘要:
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) 阅读全文
摘要:
不要直接用pip安装,因为会有编译错误。请下载下面的exe安装包:https://pypi.python.org/pypi/MySQL-python 阅读全文
摘要:
1.用Pycharm将项目check out 到本地【Quick Start】->Check out from Version Control->Git,并打开项目2.在【VCS】菜单中选择【Git】->【Rebase my Github fork】3.在【VCS】菜单中选择【Git】->【Push】 阅读全文
摘要:
参考:http://stackoverflow.com/questions/17972347/error-command-gcc-failed-no-such-file-or-directory解决方案:安装:gccwinbinaries 地址:https://github.com/develersrl/gccwinbinaries 阅读全文
摘要:
方案:需要在settings.py的ALLOWED_HOSTS参数中添加域名:如:ALLOWED_HOSTS=['*']#允许所有域名访问ALLOWED_HOSTS=['localhost']#允许本地访问参考:http://stackoverflow.com/questions/15128135/django-setting-debug-false-causes-500-error 阅读全文
摘要:
方案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 阅读全文
摘要:
1.到http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml下载并安装lxml2.在cmd中执行:pip install PyQuery 阅读全文
该文被密码保护。 阅读全文
摘要:
<?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") 阅读全文
该文被密码保护。 阅读全文