在Django编程时执行makemigrations的时候出现了报错:ImportError:No module named "MySQLdb"
处理方法:
因为python3.5安装的是pymysql插件,没有MySQLdb
在Django根目录下面的__init__文件添加如下一段代码:
import pymysql
pymysql.install_as_MySQLdb()
接着又出现了报错ImportError: cannot import name 'Thing2Literal'
处理方法:pip3 freeze查看安装的插件
Django==1.10.5
Pillow==2.4.0
PyMySQL==0.7.9
PyMySQL3==0.5
PyMySQL3 is a fork of old PyMySQL.
This means installing PyMySQL3 overwrites PyMySQL with old code.
So execute pip unistall pymysql3
然后再执行Django-> Customer Command->makemigrations, migrate就OK啦