class QuestionViewSet(viewsets.ReadOnlyModelViewSet):
    """
    API endpoint that allows questions and answers to be read.
    """
resource_name = 'questions'
queryset = Question.objects.all()
serializer_class = QuestionSerializer
How to generate JSON-API data attribute vs results attribute in Django Rest Framework JSON API?