zoukankan      html  css  js  c++  java
  • django-AttributeError: 'str' object has no attribute 'decode'

    
    一、Django数据同步过程中遇到的问题:
    以下2步骤都需要修改:
      
    
    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:Python37Libsite-packagesdjangodbackendsmysql(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:Python37libsite-packagesdjangodbackendsmysqloperations.py", line 146, in last_executed_query
    
        query = query.decode(errors='replace')
    
      AttributeError: 'str' object has no attribute 'decode'
    
      解决办法:打开此文件把146行的decode修改为encode
  • 相关阅读:
    MySQL系列(二)
    MySQL系列(一)
    RabbitMQ的安装部署
    RabbitMQ原理介绍
    消息中间件metaq
    消息中间件之zookper安装部署
    ZooKeeper基本原理
    消息中间件剖析
    了解Node.js
    windows下使用Git
  • 原文地址:https://www.cnblogs.com/vmsysjack/p/12872819.html
Copyright © 2011-2022 走看看