Skip to main content

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

  1. Add django_enhanced_pagination to your INSTALLED_APPS:
INSTALLED_APPS = [
    # ... other apps
    'django_enhanced_pagination',
]
  1. 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})
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_enhanced_pagination-1.0.1.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_enhanced_pagination-1.0.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file django_enhanced_pagination-1.0.1.tar.gz.

File metadata

File hashes

Hashes for django_enhanced_pagination-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bf964f8094ebd8d4fbc6ac67db241f5bd29385551f0e0fcd11be17084ab31cf3
MD5 4b717b7dc5dcb27484dc943fd1721c73
BLAKE2b-256 8f49bd8b4c9a92e1acf3821b042ed9facaa67c52a2f7acb6b08684519f89741f

See more details on using hashes here.

File details

Details for the file django_enhanced_pagination-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_enhanced_pagination-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2195b79c857ab1316a6379ed31ec9387815e42d1d84a26f94a5728bbff14a3b8
MD5 756f5a288fcca157ba98e0e2b7e0e476
BLAKE2b-256 3b062e0b60aa265f34ad929d50d4d1d8fa85f1fcef26ef1b7546c1558bf3fbe8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page