django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.10.1.
It is using pymysql instead of mysqlclient that caused the error.
import pymysql pymysql.version_info = (1, 4, 0, "final", 0) pymysql.install_as_MySQLdb()
Why do I know you are using pymysql?
0.10.1 is only the latest version of pymysql.
Why use pymysql instead of mysqlclient in the project?
Because it is easier to install. pymysql does not depend on system libraries, while mysqlclient depends on a series of system libraries, such as
Why is mysqlclient difficult to install, but Django still uses it by default?
Because mysqlclient is faster and has better performance. Therefore, if your project has high performance requirements, it is recommended that you delete the above compatible code, and then install mysqlclient in the project.
Install mysqlclient instead of pymysql
pip install mysqlclient
Ubuntu 14，Ubuntu 16，Debian 8.6（jessie）
sudo apt-get install python-pip python-dev libmysqlclient-dev
sudo dnf install python python-devel mysql-devel redhat-rpm-config gcc
brew install mysql-connector-c
If it fails, try
brew install mysql