I have changed an existing database for a Django project from SQLite3 to PostgreSQL and moved all the data with dumpdata
and loaddata
commands. When I'm running the server, It's giving me the following error -
ContentType 19 for <class 'easy_thumbnails.models.ThumbnailDimensions'> #233 does not point to a subclass!
I'm using django-filer which has a dependency on easy_thumbnails. I'm guessing the error is coming from there.
I have checked this link and followed teewuane's answer to reorder the django_content_type table but still no luck.
Edit: Tried excluding contenttypes and auth.permission by using -
python manage.py dumpdata --exclude auth.permission --exclude contenttypes > db.json
After loading this data into a new created PostgreSQL database, the error still persists.
Error fixed by using
--natural-foreign
and--natural-primary
flags withdumpdata
command.python manage.py dumpdata --natural-foreign --natural-primary --exclude auth.permission --exclude contenttypes > db.json