Django Mysql驱动版本问题

 

提示错误

 mysqlclient 1.3.13 or newer is required; you have 0.9.3. 

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.

 

解决方法

在项目根目录下__init__.py 文件中修改如下

import pymysql
pymysql.version_info = (1, 3, 13, "final", 0)
pymysql.install_as_MySQLdb()

 

posted @ 2020-04-06 13:01  汪丛兴  阅读(336)  评论(0编辑  收藏  举报