I have followed the advice in this presentation for upgrading Django to the latest version.
Euro Python Conference - Django Upgrade Presentation
And all has gone well until the final step. After upgrading to 4.2.7 (a library I needed didn’t have a version for 4.2.8) and Python 3.11.6 – I hit the following error when running Test All Tests in PyCharm.
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/django_test_manage.py", line 56, in <module>
django.setup()
File "/Users/john.bickerstaff/Documents/workspace/employee-maestro/venv_Django_4.2.7/lib/python3.11/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/john.bickerstaff/Documents/workspace/employee-maestro/venv_Django_4.2.7/lib/python3.11/site-packages/django/apps/registry.py", line 124, in populate
app_config.ready()
File "/Users/john.bickerstaff/Documents/workspace/employee-maestro/venv_Django_4.2.7/lib/python3.11/site-packages/django/contrib/admin/apps.py", line 27, in ready
self.module.autodiscover()
File "/Users/john.bickerstaff/Documents/workspace/employee-maestro/venv_Django_4.2.7/lib/python3.11/site-packages/django/contrib/admin/__init__.py", line 50, in autodiscover
autodiscover_modules("admin", register_to=site)
File "/Users/john.bickerstaff/Documents/workspace/employee-maestro/venv_Django_4.2.7/lib/python3.11/site-packages/django/utils/module_loading.py", line 58, in autodiscover_modules
import_module("%s.%s" % (app_config.name, module_to_search))
File "/usr/local/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 940, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/Users/john.bickerstaff/Documents/workspace/employee-maestro/venv_Django_4.2.7/lib/python3.11/site-packages/import_export/admin.py", line 521, in <module>
class ExportActionMixin(ExportMixin):
File "/Users/john.bickerstaff/Documents/workspace/employee-maestro/venv_Django_4.2.7/lib/python3.11/site-packages/import_export/admin.py", line 566, in ExportActionMixin
actions = admin.ModelAdmin.actions + [export_admin_action]
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
TypeError: can only concatenate tuple (not "list") to tuple
This is deep in Django code - the ExportActionMixin class. I’m not sure what is going on here. I’m sure all this code was tested against 3.11 before releasing 4.2.7…
Any thoughts, hints or ideas greatly appreciated…