Django之迁移数据库

执行python manage.py makemigration 出现

  1. 使用的mysql client的版本太低的话

    django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11.None

  解决

    找到Python安装路劲下的Python36-32\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.  出现  str  has no attribute 'decode'

   解决:

      Python36\lib\site-packages\django\db\backends\mysql\operations.py", line 149, in last_executed_query

      去找到这行代码 将decode改为encode即可

 

posted @ 2019-08-16 15:27  ZMZ沐梓  阅读(327)  评论(0编辑  收藏  举报