django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.
使用2.2 版本的django时,出现django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.,查了资料才知道是兼容问题
出现此类问题
方法一可删除项目根目录下__init__.py 文件中以下两行代码可修复
import pymysql
pymysql.install_as_MySQLdb()
方法二修改 D:\Program Files\Python38\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__)