An enhanced version of django-pure-pagination with additional features and improvements
Project description
Django Enhanced Pagination
An enhanced version of django-pure-pagination with additional features and improvements.
Features
- Enhanced Pagination: All the features of django-pure-pagination with additional enhancements
- Bootstrap Support: Built-in Bootstrap pagination templates
- Customizable: Easy to customize pagination display
- Django Compatible: Works with Django 2.2+ and Python 3.6+
Installation
pip install django-enhanced-pagination
Quick Start
- Add
django_enhanced_paginationto yourINSTALLED_APPS:
INSTALLED_APPS = [
# ... other apps
'django_enhanced_pagination',
]
- In your views:
from django_enhanced_pagination import Paginator, EmptyPage, PageNotAnInteger
def my_view(request):
objects = MyModel.objects.all()
paginator = Paginator(objects, 25) # Show 25 objects per page
page = request.GET.get('page')
try:
objects = paginator.page(page)
except PageNotAnInteger:
objects = paginator.page(1)
except EmptyPage:
objects = paginator.page(paginator.num_pages)
return render(request, 'my_template.html', {'objects': objects})
- In your templates:
{% load i18n %}
<div class="pagination-wrapper">
{% include "pure_pagination/pagination.html" %}
</div>
Configuration
You can customize pagination settings in your Django settings:
PAGINATION_SETTINGS = {
'PAGE_RANGE_DISPLAYED': 10,
'MARGIN_PAGES_DISPLAYED': 2,
'SHOW_FIRST_PAGE_WHEN_INVALID': True,
}
License
This project is licensed under the BSD License - see the LICENSE file for details.
Acknowledgments
- Based on django-pure-pagination by James Pacileo
- Enhanced with additional features and improvements
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_enhanced_pagination-1.0.2.tar.gz.
File metadata
- Download URL: django_enhanced_pagination-1.0.2.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e562a21a64fd85b07bf22c696e0108f44e8855f31f04588835744f8df0aaa66
|
|
| MD5 |
73cf90c36abccbbb53e75bbeca7ddd5e
|
|
| BLAKE2b-256 |
003d9afba4c4073bccb62a64cda8fba6cfc9fa4b2b213f91d1a6b9b7c1d72499
|
File details
Details for the file django_enhanced_pagination-1.0.2-py3-none-any.whl.
File metadata
- Download URL: django_enhanced_pagination-1.0.2-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fed536aa8f4d9be7855e4660c4938efb36e47ec98d5f34994f6a2c4a63c72ec
|
|
| MD5 |
8c288d742e505dc91207844a52742aa8
|
|
| BLAKE2b-256 |
f3194397497d04a9193d4d6623cf88671af863607d026155245b27d427e2f4bc
|