美文网首页
django 问题汇总

django 问题汇总

作者: GaoYangTongXue丶 | 来源:发表于2019-06-20 13:13 被阅读0次

1.MySQLclient目前只支持到python3.4,因此如果使用的更高版本的python,可以修改下面路径的文件(即python的安装路径):

...\Python3.6\Lib\site-packages\django\db\backends\mysql\base.py

注释下面代码
if version < (1, 3, 3):
  raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is required; you have %s" % Database.__version__)

2. query = query.decode(errors='replace') AttributeError: 'str' object has no attribute 'decode'

...\Python3.6\Lib\site-packages\django\db\backends\mysql\ operations.py
解决办法:打开此文件把146行的decode修改为encode

相关文章

网友评论

      本文标题:django 问题汇总

      本文链接:https://www.haomeiwen.com/subject/gyvdqctx.html