def get_categories(request): queryset = Category.objects.all() serialized = CategorySerializer(queryset, many=True) return Response(serialized.data)