..

Django Rest Framework Pagination

차이점

LimitOffsetPagination

Query Parameter로 limitoffset을 사용한다.

GET /api/v1/cer/?offset=60
{
    "count": 220,
    "next": "http://127.0.0.1:8000/api/v1/cer/?limit=30&offset=90",
    "previous": "http://127.0.0.1:8000/api/v1/cer/?limit=30&offset=30",
    "results": []
}

PageNumberPagination

Query Parameter로 page를 사용한다.

GET /api/v1/cer/?page=3
{
    "count": 220,
    "next": "http://127.0.0.1:8000/api/v1/cer/?page=4",
    "previous": "http://127.0.0.1:8000/api/v1/cer/?page=2",
    "results": []
}

참고

https://www.django-rest-framework.org/api-guide/pagination

https://donis-note.medium.com/django-rest-framework-pagination-페이징-처리-f97aaf824433