      ordering = '-created'
      template = 'rest_framework/pagination/previous_and_next.html'
  
      def paginate_queryset(self, queryset, request, view=None):
          if self.page_size is None:
              return None
  
          self.base_url = request.build_absolute_uri()
          self.ordering = self.get_ordering(request, queryset, view)
  
 
</s> remove     page_size = api_settings.PAGE_SIZE
 </s> add  </s> remove class CursorPagination(BasePagination):
 </s> add class CursorPagination(BasePageSizePagination):
        self.page_size = self.get_page_size(request)
        if not self.page_size:
      ordering = '-created'
      template = 'rest_framework/pagination/previous_and_next.html'
  
      def paginate_queryset(self, queryset, request, view=None):
        self.page_size = self.get_page_size(request)
        if not self.page_size:
              return None
  
          self.base_url = request.build_absolute_uri()
          self.ordering = self.get_ordering(request, queryset, view)
  
keep keep keep keep replace keep keep keep keep keep
 use PageSizePaginationMixin for CursorPagination
tests for custom page_size in CursorPagination 
rest_framework/pagination.py