Set 'MAX_PAGINATE_BY' to configure global maximum results per page, as indicated by doc .
Example from doc :
REST_FRAMEWORK = { 'PAGINATE_BY': 10, # Default to 10 'PAGINATE_BY_PARAM': 'page_size', # Allow client to override, using `?page_size=xxx`. 'MAX_PAGINATE_BY': 100 # Maximum limit allowed when using `?page_size=xxx`. }
Set max_paginate_by to view-based settings for a hard maximum page limit.
Example from the document:
class PaginatedListView(ListAPIView): queryset = ExampleModel.objects.all() serializer_class = ExampleModelSerializer paginate_by = 10 paginate_by_param = 'page_size'
dETAIL
source share