I have recently updated my Django project’s Python version to 3.11 and Django to 4.2.7
I tested vigorously, but did not test migrations.
I just had to add a field to the database and I now get an error when running “migrate agents”.
Note: the error does NOT occur against the sqlLite3 local database, but DOES occur running against my Dev environment which has a real MySQL 8 instance.
Also worthy of note, the following are all at their latest versions according to PiPy…
django-mysql==4.12.0
mysql-connector-python==8.3.0
PyMySQL==1.1.0
Here is the stack trace. I do understand that something is sending “too much” into something else, but am at a loss to explain exactly what and why… Nor how to fix.
Traceback (most recent call last):
File "/Users/redacted/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/233.13135.95/PyCharm.app/Contents/plugins/python/helpers/pycharm/django_manage.py", line 52, in <module>
run_command()
File "/Users/redacted/Library/Application Support/JetBrains/Toolbox/apps/PyCharm-P/ch-0/233.13135.95/PyCharm.app/Contents/plugins/python/helpers/pycharm/django_manage.py", line 46, in run_command
run_module(manage_file, None, '__main__', True)
File "<frozen runpy>", line 226, in run_module
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "/Users/redacted/Documents/workspace/redacted_app_name/manage.py", line 25, in <module>
main()
File "/Users/redacted/Documents/workspace/redacted_app_name/manage.py", line 21, in main
execute_from_command_line(sys.argv)
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
utility.execute()
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/core/management/base.py", line 412, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/core/management/base.py", line 458, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/core/management/base.py", line 106, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 100, in handle
self.check(databases=[database])
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/core/management/base.py", line 485, in check
all_issues = checks.run_checks(
^^^^^^^^^^^^^^^^^^
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/core/checks/database.py", line 13, in check_database_backends
issues.extend(conn.validation.check(**kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/db/backends/mysql/validation.py", line 9, in check
issues.extend(self._check_sql_mode(**kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/db/backends/mysql/validation.py", line 19, in _check_sql_mode
% (self.connection.display_name, self.connection.alias),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/redacted/Documents/workspace/redacted_app_name/venv_Django_4.2.7/lib/python3.11/site-packages/django/utils/functional.py", line 57, in __get__
res = instance.__dict__[self.name] = self.func(instance)
^^^^^^^^^^^^^^^^^^^
TypeError: DatabaseWrapper.display_name() takes 0 positional arguments but 1 was given
Process finished with exit code 1
Any hints gratefully accepted!
If you want to see more (database settings etc) let me know…