MakeMigration Error on Django - ImportError: cannot import name 'FieldDoesNotExist' from 'django.db.models'
Your version of django-allauth
has the incorrect import for FieldDoesNotExist
. The correct import is:
from django.core.exceptions import FieldDoesNotExist
The import from django.db.models
presumably worked in older versions of Django.
The import was fixed in django-allauth
in version 0.41.0. If you update django-allauth
in your requirements.txt
or pipenv it should fix the problem.
In my case, Django version 3.1.3
conflicted with django-filter 2.0.0
.
Similar error message. But the last lines of error said that it was graphene-django
. However, in the middle, it says django-filter
. When I looked into the django-filter
source file, there was a wrong import of FieldDoesNotExist
. When I upgrade django-filter
to version 2.4.0
, problem solved.