当前位置:   article > 正文

Django学习过程中遇到的问题_jdango报错: raise improperlyconfigured( django.core.

jdango报错: raise improperlyconfigured( django.core.exceptions.improperlycon

一、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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/一键难忘520/article/detail/979550
推荐阅读
相关标签
  

闽ICP备14008679号