django3.1使用pymysql报错 mysqlclient 1.4.0 or newer is required; you have 0.10.1.

警告
本文最后更新于 2020-10-12 16:56,文中内容可能已过时。

raise ImproperlyConfigured(‘mysqlclient 1.4.0 or newer is required; you have %s.’ % Database.version) django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.10.1.

修改__init__.py(settings.py同级目录下)

1
2
3
import pymysql
pymysql.install_as_MySQLdb()
pymysql.version_info = (1, 4, 13, "final", 0)
请我喝杯水
SoulChild 微信号 微信号
SoulChild 微信打赏 微信打赏
0%