django-background-tasks icon indicating copy to clipboard operation
django-background-tasks copied to clipboard

ImportError: cannot import name 'GenericForeignKey' from 'compat'

Open Wissperwind opened this issue 3 years ago • 1 comments

Hi, I get an error if I try to use background tasks:

Traceback (most recent call last):
  File "C:\Test_Installation\pythonEnvironmentWithAllStuff\lib\site-packages\compat\models.py", line 3, in <module>
    from compat import GenericForeignKey
ImportError: cannot import name 'GenericForeignKey' from 'compat' (C:\GlobalX_Installation\pythonEnvironmentWithAllStuff\lib\site-packages\compat\__init__.py)

I use Python 3.9 and Django 3.2.

Do you need further information? Which one?

These are my installed apps:

INSTALLED_APPS = [
    'jobs',
    'django_filters',
    'rest_framework',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'drf_spectacular',
    'djangodav',
    'background_task',
]

Wissperwind avatar Apr 07 '21 11:04 Wissperwind

I have having this error too. Seems like a compatibility issue with latest django version

sumanshusamarora avatar Jun 21 '21 22:06 sumanshusamarora