{"id":14972903,"url":"https://github.com/matagus/django-pagination-py3","last_synced_at":"2025-10-01T22:31:27.603Z","repository":{"id":15463497,"uuid":"18196661","full_name":"matagus/django-pagination-py3","owner":"matagus","description":"🗂️ A port of ericflo/django-pagination to Python 3 + Django 4.x and 5.x","archived":false,"fork":true,"pushed_at":"2024-11-23T20:46:41.000Z","size":706,"stargazers_count":12,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-23T22:29:14.710Z","etag":null,"topics":["django","django-app","django-application","library","pagination","python"],"latest_commit_sha":null,"homepage":"https://django-pagination-py3.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ericflo/django-pagination","license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matagus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-28T00:45:22.000Z","updated_at":"2024-11-23T20:46:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/matagus/django-pagination-py3","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matagus%2Fdjango-pagination-py3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matagus%2Fdjango-pagination-py3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matagus%2Fdjango-pagination-py3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matagus%2Fdjango-pagination-py3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matagus","download_url":"https://codeload.github.com/matagus/django-pagination-py3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234908960,"owners_count":18905500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","django-app","django-application","library","pagination","python"],"created_at":"2024-09-24T13:47:43.314Z","updated_at":"2025-10-01T22:31:22.313Z","avatar_url":"https://github.com/matagus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-pagination-py3\n====================\n\n![Python Compatibility](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue.svg) [![PyPi Version](https://img.shields.io/pypi/v/django-pagination-py3.svg)](https://pypi.python.org/pypi/django-pagination-py3)  ![CI badge](https://github.com/matagus/django-pagination-py3/actions/workflows/ci.yml/badge.svg) [![codecov](https://codecov.io/gh/matagus/django-pagination-py3/graph/badge.svg?token=a64SxEDQk0)](https://codecov.io/gh/matagus/django-pagination-py3) [![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\nA port of [ericflo/django-pagination](https://github.com/ericflo/django-pagination) to Python 3. Updated to be compatible with Django 4.x and 5.0.\n\nFor versions compatible with Django 3.x and Python 2.7+ please install or download version `1.2.0` from [Releases](https://github.com/matagus/django-pagination-py3/releases) or\n[Pypi](https://pypi.org/project/django-pagination-py3/).\n\nFeatures\n========\n\n- Really easy to use at template level.\n- It preserves all request's querystring parameters.\n- Settings to customize behavior.\n- Translated to fr, de, es, pt, pl and pt_BR.\n- A fully working example project.\n\n\nInstallation\n============\n\nInstall using `pip` command:\n\n```bash\npip install django-pagination-py3\n```\n\n...or clone the repo and install it using `pip`:\n\n```bash\ngit clone git://github.com/matagus/django-pagination-py3.git\ncd django-pagination-py3\npip install -e .\n```\n\nAdd `pagination` INSTALLED_APPS to your `settings.py`:\n\n```python\nINSTALLED_APPS = (\n    # ...\n    \"pagination\",\n)\n```\n\nAdd the middleware:\n\n```python\n   MIDDLEWARE_CLASSES = (\n       # ...\n       'pagination.middleware.PaginationMiddleware',\n   )\n```\n\nAdd this line at the top of your template to load the pagination tags:\n\n```html\n  {% load pagination_tags %}\n```\n\nDecide on a variable that you would like to paginate, and use the autopaginate tag on that variable before iterating\nover it. This could take one of two forms (using the canonical `object_list` as an example variable):\n\n```html\n  {% autopaginate object_list %}\n```\n\nThis assumes that you would like to have the default 20 results per page. If you would like to specify your own amount\nof results per page, you can specify that like so:\n\n```html\n  {% autopaginate object_list 10 %}\n```\n\nNote that this replaces ``object_list`` with the list for the current page, so you can iterate over the `object_list`\nlike you normally would.\n\n\nNow you want to display the current page and the available pages, so somewhere after having used autopaginate, use the\npaginate inclusion tag:\n\n```html\n  {% paginate %}\n```\n\nThis does not take any arguments, but does assume that you have already called autopaginate, so make sure to do so first.\n\n\nThat's it! You have now paginated `object_list` and given users of the site a way to navigate between the different\npages--all without touching your views.\n\n\nRunning Tests\n-------------\n\n`hatch run test:test` will run the tests in every Python + Django versions combination.\n\n`hatch run test.py3.12-5.0:test`: will run them for python 3.12 and Django 5.0. Please see possible combinations using\n`hatch env show` (\"test\" matrix).\n\n\nLicense\n=======\n\n`django-pagination-py3` is released under an BSD License - see the `LICENSE` file for more information.\n\n\nAcknowledgements\n================\n\nDevelop \u0026 built using [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![code style - black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nPosts I learned from:\n\n- [Switching to Hatch](https://andrich.me/2023/08/switching-to-hatch/)\n- [Automate Hatch Publish with GitHub Actions](https://blog.pecar.me/automate-hatch-publish)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatagus%2Fdjango-pagination-py3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatagus%2Fdjango-pagination-py3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatagus%2Fdjango-pagination-py3/lists"}