_

django: AttributeError: 'str' object has no attribute 'decode'

 

时间:2019-11-07 来源:人云亦云


 

一、Django数据同步过程中遇到的问题:

1、raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)

   django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

  解决办法:C:\Python37\Lib\site-packages\django\db\backends\mysql(python安装目录)打开base.py,注释掉以下内容:

        if version < (1, 3, 13):

          raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)

  

2、File "C:\Python37\lib\site-packages\django\db\backends\mysql\operations.py", line 146, in last_executed_query

    query = query.decode(errors='replace')

  AttributeError: 'str' object has no attribute 'decode'

  解决办法:打开此文件把146行的decode修改为encode

转自:http://www.cnblogs.com/xiaobinglife/articles/10716605.html


赞助打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开微信扫一扫,即可进行扫码打赏哦

您的支持,鼓励我们做得更好!

「人云亦云」


标签: 涨知识 | 如有转载,请注明出处 |
本文链接:
http://blog.hellotom.top/articles/946/


亲,看完记得留下足迹哦


更多有料好玩的内容 尽在人云亦云公众号
360网站安全检测平台