Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

django-leafage

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-leafage

Simple and Easiest paginator for Django.

  • 1.2.5
  • PyPI
  • Socket score

Maintainers
1

Django Leafage

Description

Simple and Easiest paginator for Django.

Installation

pip install django-leafage

Quick start

  1. Add "leafage" to your INSTALLED_APPS in settings.py like this::

    INSTALLED_APPS = [
        ...
        'leafage',
        ...
    ]
    
  2. Ensure "APP_DIRS" to "True" in settings.py like this::

    TEMPLATES = [
        {
            ...
            'DIRS': [],
            'APP_DIRS': True,
            ...
        },
    ]
    
  3. In views import leafage like this::

    import leafage
    
    def home(request):
    """
        Home page handler.
    """
    template = 'home.html'
    
    per_page_obj = 10 # default = 10(if not provided)
    
    queryset = Model.objects.all()
    queryset = leafage.pagination(request=request, obj_list=queryset, obj_count=per_page_obj)
    
    context = {
        'queryset': queryset
    }
    return render(request, template, context)
    
    
  4. At beginning of template include following code and template look like this::

    {% load leafage %}
    
  5. End of template add following code look like this::

    {% paginate request=request object_list=queryset %}
    

Licence

Copyright (c) 2020 Nilesh Kumar Dubey

This repository is licensed under the MIT license. See LICENSE for details

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc