I am using Django 3.1.0 and I get the error below when I set MySQL as a database on production server.
#ERROR
Getting django.core.exceptions.ImproperlyConfigured: mysqlclient 1.4.0 or newer is required; you have 0.10.1. error while using MySQL in Django
My server is an apache server and uses Cpanel and it is a python server, not a vps one.
I have tried installing mysqlclient and PyMySQL and adding the below code to the __init__.py file.
import pymysql
pymysql.version_info = (1, 3, 13, "final", 0)
pymysql.install_as_MySQLdb()
and it is my DB config is Django
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'sadraedu_mydb',
'USER': 'sadraedu_mydbu',
'PASSWORD': '*******',
'HOST': 'localhost',
'PORT': '3306',
}
}
Any help would be appreciated.