执行python manage.py makemigration 出现
- 使用的mysql client的版本太低的话
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11.None
解决
找到Python安装路劲下的Python36-32Libsite-packagesdjangodbackendsmysqlase.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'
解决:
Python36libsite-packagesdjangodbackendsmysqloperations.py", line 149, in last_executed_query
去找到这行代码 将decode改为encode即可