I'm working with django rest framework but I face this problem with the pagination the output Show in next and previous the page link but I want the page number only
my pagination.py
from rest_framework.pagination import PageNumberPagination
class MycustomPagination(PageNumberPagination):
page_size = 5
page_size_query_param = 'page_size'
max_page_size = 10
page_query_param = 'page'
my views.py
from .paginations import MMycustomPagination
class AllSerialed(ListAPIView):
pagination_class = MycustomPagination
queryset = MyModel.objects.filter(blacklist=False).order_by("-date")
serializer_class = MyModelSerial
simple output
{
"count": 20,
"next": "http://127.0.0.1:7000/data/?page=3",
"previous": "http://127.0.0.1:7000/data/?page=1",
"results": [
]
}