django遇到的坑

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.

解决办法:
在Python37\Lib\site-packages\django\db\backends\mysql\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

你可能感兴趣的:(django遇到的坑)