Skip to content

Instantly share code, notes, and snippets.

@63phc
Created May 27, 2019 14:51
Show Gist options
  • Save 63phc/fac0c05d6dd1123575f8676b00cb4215 to your computer and use it in GitHub Desktop.
Save 63phc/fac0c05d6dd1123575f8676b00cb4215 to your computer and use it in GitHub Desktop.
from rest_framework import pagination
from rest_framework.response import Response
class NewsPageNumberPagination(pagination.PageNumberPagination):
page_size_query_param = 'count'
max_page_size = 100
def get_paginated_response(self, data):
return Response(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment