1、运行python manage.py makemigrations 出现的问题:
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.3 or newer is required; you have 0.7.11
找到Python安装路劲下的Python36-32\Lib\site-packages\django\db\backends\mysql\base.py
使用anaconda自带的python环境要找到
C:\Users\YANG\Anaconda3\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__)
重新在项目manage.py路劲下执行如下命令即可
2、运行 python manage.py migrate 遇到的问题
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