          pagination_serializer_class = SerializerClass
          context = self.get_serializer_context()
          return pagination_serializer_class(instance=page, context=context)
  
  
  class SingleObjectAPIView(SingleObjectMixin, GenericAPIView):
      """
      Base class for generic views onto a model instance.
      """
 
</s> remove         return SerializerClass

    def get_pagination_serializer(self, page=None):
        pagination_serializer_class = self.get_pagination_serializer_class()
 </s> add         pagination_serializer_class = SerializerClass </s> remove     def get_paginate_by(self, queryset):
        if self.page_size_kwarg is not None:
            page_size_kwarg = self.request.QUERY_PARAMS.get(self.page_size_kwarg)
            if page_size_kwarg:
                try:
                    page_size = int(page_size_kwarg)
                    return page_size
                except ValueError:
                    pass
        return super(ListModelMixin, self).get_paginate_by(queryset)

 </s> add  </s> remove from rest_framework.settings import api_settings
 </s> add  </s> remove class CustomPageSizeKwargView(generics.ListAPIView):
 </s> add class PaginateByParamView(generics.ListAPIView): </s> remove     page_size_kwarg = 'ps'


class NonePageSizeKwargView(generics.ListAPIView):
    """
    View for testing None page_size usage
    """
    model = BasicModel
    page_size_kwarg = None
 </s> add     paginate_by_param = 'page_size'
    def get_paginate_by(self, queryset):
        """
        Return the size of pages to use with pagination.
        """
        if self.paginate_by_param:
            params = self.request.QUERY_PARAMS
            try:
                return int(params[self.paginate_by_param])
            except (KeyError, ValueError):
                pass
        return self.paginate_by

          pagination_serializer_class = SerializerClass
          context = self.get_serializer_context()
          return pagination_serializer_class(instance=page, context=context)
  
    def get_paginate_by(self, queryset):
        """
        Return the size of pages to use with pagination.
        """
        if self.paginate_by_param:
            params = self.request.QUERY_PARAMS
            try:
                return int(params[self.paginate_by_param])
            except (KeyError, ValueError):
                pass
        return self.paginate_by

  
  class SingleObjectAPIView(SingleObjectMixin, GenericAPIView):
      """
      Base class for generic views onto a model instance.
      """
keep keep keep add keep keep keep keep keep
 Polishing to page size query parameters & more docs 
rest_framework/generics.py