4π
I just met this problem.
in your database, there is a table named django_content_type.
because u have some older content_type with the same name.
u can use the sqlitebrowser to delete these.
π€sandor ZHAO
0π
If you want to debug, I suggest you to used filter instead of get.
In your view:
content_type = ContentType.objects.filter(model=c_type)
print(content_type)
Now in content_type you will have your 2 objects.
π€Wilfried
- [Django]-Error in django interactive shell on pydev eclipse
- [Django]-What is a good way to get the dynamic title of a page in Django?
- [Django]-Polling celery task and return on display
- [Django]-Docker setting up gdal for django
- [Django]-Save model int() argument must be a string or a number, not 'tuple'
Source:stackexchange.com