def is_following(self, request,  content_type_id, object_id):
        """
        Returns a JSON response whether the current user is following the object from content_type_id/object_id pair
        """
        ctype = get_object_or_404(ContentType, id=content_type_id)
        instance = ctype.get_object_for_this_type(pk=object_id)
        following = models.Follow.objects.is_following(request.user, instance)
        data = {'is_following': following}
        return Response(json.dumps(data))

        Returns a JSON response whether the current user is following the object from content_type_id/object_id pair
        
actstream/drf/views.py