Add infinite scroll to any django app.

Overview

django-infinite-scroll

Add infinite scroll to any django app.

Features

- Allows to add infinite scroll to any page.
- Works with Django's Queryset or any kind of lists.
- Requires no aditional javascript framework.
- Easy to install and set up.

Quicksetup

With docker compose:

    git clone https://github.com/gsteixeira/django-infinite-scroll.git
    cd django-infinite-scroll/example/
    docker-compose up

Go to http://localhost:8000 and try it out. 8)

installation

Install module.

    pip install django-infinite-scroll

Add to settings.py

    INSTALLED_APPS = [
        # ...
        'infscroll',
    ]

First, let's make a view that will load the dynamic content:

    def more(request):
        # This is the list that will be paginated.
        list_items = MyModel.objects.all()
        return more_items(request, list_items,
                          # (optional) your custom template
                          template='more.html')

Add it to urls.py

    path('more/', myapp.views.more, name='more'),

Finally, Add to the view you want to show the infinite scroll:

    def my_view(request):
        # The list of items to be paginated. It can be any list of queryset.
        list_items = MyModel.objects.all()
        paginated = get_pagination(request, list_items)
        # we must declare the url where it will load more stuff
        data = {
            'more_posts_url': reverse('more'),
            }
        # update with paginated info
        data.update(paginated)
        return render(request, 'my_view.html', data)

Now add to your template:

    {% load infinite_scroll %}
    <html>
        <body>
            <p>Hellop>
            
            {% infinite_scroll_box %}
            
            {% set_infinite_scroll %}
        body>
    html>

Now go to the page of "my_view", and you should have infinite scroll!

(optional) If you want to use a custom "load_more" template

Here is an example:

    {% load infinite_scroll %}
    {% for item in feed %}
        {{ item }}
    {% endfor %}
    {% infinite_scroll_tags %}

Just add this for loop to iterate the list and include the scroll tags

Settings

PAGINATION_STEPS - the amount of items each step will load. Default to 10.

Requirements

- python3
- django
Owner
Gustavo Teixeira
coding my way out of here
Gustavo Teixeira
A small Django app to easily broadcast an announcement across a website.

django-site-broadcasts The site broadcast application allows users to define short messages and announcements that should be displayed across a site.

Ben Lopatin 12 Jan 21, 2020
Use minify-html, the extremely fast HTML + JS + CSS minifier, with Django.

django-minify-html Use minify-html, the extremely fast HTML + JS + CSS minifier, with Django. Requirements Python 3.8 to 3.10 supported. Django 2.2 to

Adam Johnson 60 Dec 28, 2022
Yummy Django API, it's the exclusive API used for the e-yummy-ke vue web app

Yummy Django API, it's the exclusive API used for the e-yummy-ke vue web app

Am.Chris_KE 1 Feb 14, 2022
A Blog Management System Built with django

Blog Management System Backend use: Django Features Enhanced Ui

Vishal Goswami 1 Dec 06, 2021
A simple trivia quizzz web app made using django

Trivia Quizzz A simple trivia quizzz web app made using django Demo http://triviaquizzz.herokuapp.com/ & https://triviaquiz.redcrypt.xyz Features Goog

Rachit Khurana 2 Feb 10, 2022
A Django app that creates automatic web UIs for Python scripts.

Wooey is a simple web interface to run command line Python scripts. Think of it as an easy way to get your scripts up on the web for routine data anal

Wooey 1.9k Jan 08, 2023
Django model mixins and utilities.

django-model-utils Django model mixins and utilities. django-model-utils supports Django 2.2+. This app is available on PyPI. Getting Help Documentati

Jazzband 2.4k Jan 04, 2023
User Authentication In Django/Ajax/Jquery

User Authentication In Django/Ajax/Jquery Demo: Authentication System Using Django/Ajax/Jquery Demo: Authentication System Using Django Overview The D

Suman Raj Khanal 10 Mar 26, 2022
Radically simplified static file serving for Python web apps

WhiteNoise Radically simplified static file serving for Python web apps With a couple of lines of config WhiteNoise allows your web app to serve its o

Dave Evans 2.1k Dec 15, 2022
PEP-484 stubs for Django

pep484 stubs for Django This package contains type stubs and a custom mypy plugin to provide more precise static types and type inference for Django f

TypedDjango 1.1k Dec 30, 2022
Custom Django field for using enumerations of named constants

django-enumfield Provides an enumeration Django model field (using IntegerField) with reusable enums and transition validation. Installation Currently

5 Monkeys 195 Dec 20, 2022
Easily share data across your company via SQL queries. From Grove Collab.

SQL Explorer SQL Explorer aims to make the flow of data between people fast, simple, and confusion-free. It is a Django-based application that you can

Grove Collaborative 2.1k Dec 30, 2022
Sampling profiler for Python programs

py-spy: Sampling profiler for Python programs py-spy is a sampling profiler for Python programs. It lets you visualize what your Python program is spe

Ben Frederickson 9.5k Jan 01, 2023
Add infinite scroll to any django app.

django-infinite-scroll Add infinite scroll to any django app. Features - Allows to add infinite scroll to any page.

Gustavo Teixeira 1 Dec 26, 2021
This "I P L Team Project" is developed by Prasanta Kumar Mohanty using Python with Django web framework, HTML & CSS.

I-P-L-Team-Project This "I P L Team Project" is developed by Prasanta Kumar Mohanty using Python with Django web framework, HTML & CSS. Screenshots HO

1 Dec 15, 2021
Realworld - Realworld using Django and HTMX

Realworld - Realworld using Django and HTMX

Dan Jacob 53 Jan 05, 2023
Simple tagging for django

django-taggit This is a Jazzband project. By contributing you agree to abide by the Contributor Code of Conduct and follow the guidelines. django-tagg

Jazzband 3k Jan 02, 2023
Inject an ID into every log message from a Django request. ASGI compatible, integrates with Sentry, and works with Celery

Django GUID Now with ASGI support! Django GUID attaches a unique correlation ID/request ID to all your log outputs for every request. In other words,

snok 300 Dec 29, 2022
Django And React Notes App

Django & React Notes App Cloning the repository -- Clone the repository using the command below : git clone https://github.com/divanov11/Django-React

Dennis Ivy 136 Dec 27, 2022
🔃 A simple implementation of STOMP with Django

Django Stomp A simple implementation of STOMP with Django. In theory it can work with any broker which supports STOMP with none or minor adjustments.

Juntos Somos Mais 32 Nov 08, 2022