I am getting the following error when running "python manage.py migrate" in cpanel terminal. I am using mysql for database. The library that I am using is mysql-connector-python.
TypeError: DatabaseWrapper.display_name() takes 0 positional arguments but 1 was given
The following are the settings of my settings file:
DATABASES = {
"default": {
"ENGINE": "mysql.connector.django",
"NAME": "my-database-name",
"HOST": "localhost",
"PORT": "3306",
"USER": "my-database-username",
"PASSWORD": "my-password",
}
}
2
Answers
I guess you were using virtual environment. Use pymysql, it worked for me.
First, config settings.py with DATABASES like this
}
And put on the top of manage.py and wsgi.py
And finally,
the code should be this way