raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have Database.__vers

搭建Django2.0+Python3+MySQL5时同步数据库时报错:
raise ImproperlyConfigured(‘mysqlclient 1.3.13 or newer is required; you have %s.’ % Database.version)
django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 0.9.3.

解决办法:

找到Python安装路劲下的Python37\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路径下执行如下命令即可

你可能感兴趣的:(Django)