Hi all,
I just upgraded my Django 3.2.10 project (Python 3.8 on Windows 10) to Django 4.0 and just this change causes the django-background-tasks 1.2.5 to fail on import:
Traceback (most recent call last):
File "py_code/UI/manage.py", line 21, in <module>
main()
File "py_code/UI/manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "D:\data\Python\RoyalRangers\venv\lib\site-packages\django\core\management\__init__.py", line 425, in execute_from_command_line
utility.execute()
File "D:\data\Python\RoyalRangers\venv\lib\site-packages\django\core\management\__init__.py", line 401, in execute
django.setup()
File "D:\data\Python\RoyalRangers\venv\lib\site-packages\django\__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "D:\data\Python\RoyalRangers\venv\lib\site-packages\django\apps\registry.py", line 114, in populate
app_config.import_models()
File "D:\data\Python\RoyalRangers\venv\lib\site-packages\django\apps\config.py", line 300, in import_models
self.models_module = import_module(models_module_name)
File "c:\program files\python38\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\data\Python\RoyalRangers\venv\lib\site-packages\background_task\models.py", line 9, in <module>
from compat import StringIO
File "D:\data\Python\RoyalRangers\venv\lib\site-packages\compat\__init__.py", line 48, in <module>
from django.conf.urls.defaults import url, include, handler404, handler500 # pyflakes:ignore
ModuleNotFoundError: No module named 'django.conf.urls.defaults'
Downgrading back to 3.2.10 removes the problem. Any idea what might be wrong?
Thanks Vranoch