Registry / database / django-cursor-pagination

django-cursor-pagination

JSON →
library0.3.0pypypiunverified

Cursor-based pagination for Django models, providing efficient and stable pagination for large datasets. Current version: 0.3.0. Released sporadically, last update in 2024.

pip install django-cursor-pagination
INSTALL
IMPORT
SIG · DJANGO-CURSOR-PAGI
D
django-cursor-pagination
databasepythonv0.3.0
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CursorPagination
from cursor_pagination import CursorPagination
from cursor_pagination import CursorPagination

Create a custom pagination class and use it in a Django REST Framework view. Cursor pagination provides stable, efficient pagination for large datasets.

from cursor_pagination import CursorPagination class MyPagination(CursorPagination): ordering = '-created' # or use 'created' for ASC page_size = 20 # Then in your view: # from rest_framework.generics import ListAPIView # class MyListView(ListAPIView): # queryset = MyModel.objects.all() # pagination_class = MyPagination
Debug
Known issues
gotchaThe 'ordering' field must be a unique or nearly unique field (e.g., primary key, created timestamp with timezone). Non-unique ordering can cause missing or duplicate results.
fix
Use a field like '-created' or 'id' that is unique in practice. Avoid fields with many duplicates.
affects: all
gotchaCursor pagination does not support arbitrary page numbers. It only provides 'next' and 'previous' cursors. Do not expect page query parameter like '?page=3'.
fix
Use cursor-based links from response instead of manual page numbers.
affects: all
breakingVersion 0.3.0 added async queryset evaluation support. If you upgrade from <0.3.0, ensure your code doesn't rely on synchronous-only behavior.
fix
Test with async views if applicable. The change is backward-compatible for sync usage.
affects: <0.3.0
Upgrade
Version history
0.3.0latest on PyPI · released Jul 1, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
django-cursor-pagination — pip install django-cursor-pagination · libregistry