django-cursor-pagination
Cursor based pagination for Django
Decision gist · record as of 2026-08-14
Yes, if you need cursor-based pagination for Django. The package is production-stable, actively maintained, has no security vulnerabilities, zero dependencies, and solves a real problem for feed-style interfaces. Install it if you're building an API with infinite scroll or Relay-style pagination; skip it if you need traditional page-number navigation or total-count information.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Ordering fields must uniquely identify objects across the entire queryset; NULL values are sorted to the end regardless of ASC/DESC direction.
- Low friction: no runtime dependencies, pure Python wheel distribution.
- Repository is active with recent commits and production-stable classification.
License · maintenance · safety
BSD (permissive) — BSD permissive license allows commercial use, modification, and distribution with minimal restrictions.
last release 2024-07-01 (774 days) · last repo commit 2026-04-15 · 167 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 110,475 downloads/mo, #12,458 on PyPI
Alternatives
Verify before relying
pip install django-cursor-pagination
from django_cursor_pagination import CursorPaginator
qs = Post.objects.all()
paginator = CursorPaginator(qs, ordering=('-created', '-id'))
page = paginator.page(first=10, after=cursor)
has_next = page.has_next
last_cursor = paginator.cursor(page[-1])- Whether async support (apage method) works with all Django versions listed in classifiers
- Performance characteristics compared to offset pagination at very large dataset sizes
- Compatibility with custom database backends beyond standard PostgreSQL/MySQL
What it is and what it does
django-cursor-pagination provides a cursor-based pagination system for Django querysets as an alternative to traditional offset-based pagination. Instead of requesting page numbers, you navigate by passing cursor tokens that represent positions in the result set, asking for records after or before a given cursor. This approach prevents data shifts when new records are inserted and avoids expensive large-offset database queries.
The package requires that ordering fields be unique across all records—typically achieved by ordering on a timestamp and an ID. It supports both synchronous and asynchronous pagination, and handles forward and reverse navigation. The trade-off is that you cannot easily determine the total number of pages or jump to arbitrary positions in the dataset, making it best suited for infinite-scroll or feed-style interfaces rather than traditional paginated navigation.
Use it for
- Building infinite-scroll feeds or timelines where new content is constantly added
- Implementing Relay-style pagination for API endpoints
- Paginating large datasets efficiently without expensive offset calculations
- Creating mobile-friendly APIs that fetch data incrementally as users scroll
- Ensuring consistent pagination results when database records are inserted between requests
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need cursor-based pagination for Django.
The package is production-stable, actively maintained, has no security vulnerabilities, zero dependencies, and solves a real problem for feed-style interfaces. Install it if you're building an API with infinite scroll or Relay-style pagination; skip it if you need traditional page-number navigation or total-count information.
Install
django-cursor-pagination on PyPI
Before you install
Low friction: no runtime dependencies, pure Python wheel distribution. Repository is active with recent commits and production-stable classification.
Ordering fields must uniquely identify objects across the entire queryset; NULL values are sorted to the end regardless of ASC/DESC direction.
License in practice
BSD permissive license allows commercial use, modification, and distribution with minimal restrictions.
Quickstart
pip install django-cursor-pagination
from django_cursor_pagination import CursorPaginator
qs = Post.objects.all()
paginator = CursorPaginator(qs, ordering=('-created', '-id'))
page = paginator.page(first=10, after=cursor)
has_next = page.has_next
last_cursor = paginator.cursor(page[-1])
Verify before relying
- Whether async support (apage method) works with all Django versions listed in classifiers
- Performance characteristics compared to offset pagination at very large dataset sizes
- Compatibility with custom database backends beyond standard PostgreSQL/MySQL
Package facts
| License | BSD permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 774 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 110,475 / month, #12,458 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: django_cursor_pagination-0.3.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “cursor pagination django”
- django-cursor-paginationImplements cursor-based pagination for Django querysets, allowing…
- grapheneGraphene is a Python library for building GraphQL schemas and types…
- sqlakeysetImplements keyset-based paging for SQLAlchemy queries, replacing…
Give your agent the search over MCP, or paste the wish link into any chat.
More Dynamic Content packages
MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.
Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.
Soupsieve is a CSS selector library designed to work with Beautiful Soup 4 to select, match, and filter HTML and XML elements using modern CSS selectors from CSS level 1 through CSS level 4 specifications.
Install it if you use Beautiful Soup for HTML or XML parsing and want modern CSS selector support.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
Flask is a lightweight WSGI web application framework for building web applications in Python, from simple single-page sites to complex multi-route applications.
Mako compiles Python-embedded templates into Python modules for fast rendering, supporting layout inheritance, custom functions, and direct Python expressions within template syntax.
See also django-chunkator · fastapi-pagination · sqlakeyset · django-tables2 · django-admin-inline-paginator-plus · djangorestframework-datatables · django-admin-inline-paginator · graphene-django-optimizer · django-mock-queries · django-datatables-view