1👍
✅
As Django documentation when you use the get_queryset method it should return Queryset that will be used to retrieve the object that this view will display.
https://docs.djangoproject.com/en/4.0/ref/class-based-views/mixins-single-object/#django.views.generic.detail.SingleObjectMixin.get_queryset
the query is wrong you must specify what you want from filter name like add __icontains or __contains
def get_queryset(self):
return ContentPost.objects.filter(category__name__icontains=self.kwargs['category'])
Source:stackexchange.com