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
Metadata
Release files for django-enhanced-pagination 1.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_enhanced_pagination-1.0.8.tar.gz | 9.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_enhanced_pagination-1.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.4 kB
Release files / django_enhanced_pagination-1.0.8.tar.gz
| Download URL | django_enhanced_pagination-1.0.8.tar.gz |
|---|---|
| Size | 9.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d099b8497a2e608a243ee109694d2be859de657540b4a312973b3dee626e85b8
|
|
BLAKE2b-256 checksum How to use checksums |
884a805e01c57c291130b39dbd8016311ead449d05b1ca5d816df0d7d61eefaf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / django_enhanced_pagination-1.0.8-py3-none-any.whl
| Download URL | django_enhanced_pagination-1.0.8-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b196986e5dee33cf5d1748f13131af5ba571c69f0dcfaa9597aa39679d6040b1
|
|
BLAKE2b-256 checksum How to use checksums |
391708133c54473188b7efe283f1d3de58ee8047cddb23eb3e0bfbcd3f9060d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|