django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.9.3. 报错解决

 报错信息

django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.9.3.

原因

原因是 MySQLclient 目前只支持到 Python3.4,而我使用了更高版本的 python(Python3.7)

处理方式

在setting.py同文件夹下的_init_.py加入以下内容

import pymysql
 
pymysql.version_info = (1, 4, 13, "final", 0)   # 指定版本
pymysql.install_as_MySQLdb() 

 

posted @ 2020-12-06 11:28  局长  阅读(2396)  评论(0编辑  收藏  举报