Django Mysql驱动版本问题

Posted 汪丛兴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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()

 

以上是关于Django Mysql驱动版本问题的主要内容,如果未能解决你的问题,请参考以下文章