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
Agenda feita usando o django para adicionar eventos

Agenda de Eventos Projeto Agenda com Django Inicio O projeto foi iniciado no Django, usando o models.py foi adicionado os dados dos eventos e feita as

Bruno Fernandes 1 Apr 14, 2022
Service request portal on top of Ansible Tower

Squest - A service request portal based on Ansible Tower Squest is a Web portal that allow to expose Tower based automation as a service. If you want

Hewlett Packard Enterprise 183 Jan 04, 2023
GameStop clone with Django

GameStop clone with Django This is my side project with GameStop clone Author: HackerApe GitHub Profile: View Profile LinkedIn Profile: View Profile

Dmitriy Shin 2 Dec 26, 2021
Auth module for Django and GarpixCMS

Garpix Auth Auth module for Django/DRF projects. Part of GarpixCMS. Used packages: django rest framework social-auth-app-django django-rest-framework-

GARPIX CMS 18 Mar 14, 2022
A small and lightweight imageboard written with Django

Yuu A small and lightweight imageboard written with Django. What are the requirements? Python 3.7.x PostgreSQL 14.x Redis 5.x FFmpeg 4.x Why? I don't

mint.lgbt 1 Oct 30, 2021
A handy tool for generating Django-based backend projects without coding. On the other hand, it is a code generator of the Django framework.

Django Sage Painless The django-sage-painless is a valuable package based on Django Web Framework & Django Rest Framework for high-level and rapid web

sageteam 51 Sep 15, 2022
Set the draft security HTTP header Permissions-Policy (previously Feature-Policy) on your Django app.

django-permissions-policy Set the draft security HTTP header Permissions-Policy (previously Feature-Policy) on your Django app. Requirements Python 3.

Adam Johnson 78 Jan 02, 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
A Django web application that allows you to be in the loop about everything happening in your neighborhood.

A Django web application that allows you to be in the loop about everything happening in your neighborhood. From contact information of different handyman to meeting announcements or even alerts.

Kennedy Ngugi Mwaura 3 Dec 11, 2022
A simple Blog Using Django Framework and Used IBM Cloud Services for Text Analysis and Text to Speech

ElhamBlog Cloud Computing Course first assignment. A simple Blog Using Django Framework and Used IBM Cloud Services for Text Analysis and Text to Spee

Elham Razi 5 Dec 06, 2022
Simply integrate Summernote editor with Django project.

django-summernote Summernote is a simple WYSIWYG editor. django-summernote allows you to embed Summernote into Django very handy. Support admin mixins

Summernote 936 Jan 02, 2023
Awesome Django Markdown Editor, supported for Bootstrap & Semantic-UI

martor Martor is a Markdown Editor plugin for Django, supported for Bootstrap & Semantic-UI. Features Live Preview Integrated with Ace Editor Supporte

659 Jan 04, 2023
DCM is a set of tools that helps you to keep your data in your Django Models consistent.

Django Consistency Model DCM is a set of tools that helps you to keep your data in your Django Models consistent. Motivation You have a lot of legacy

Occipital 59 Dec 21, 2022
mirage ~ ♪ extended django admin or manage.py command.

mirage ~ ♪ extended django admin or manage.py command. ⬇️ Installation Installing Mirage with Pipenv is recommended. pipenv install -d mirage-django-l

Shota Shimazu 6 Feb 14, 2022
Bootstrap 3 integration with Django.

django-bootstrap3 Bootstrap 3 integration for Django. Goal The goal of this project is to seamlessly blend Django and Bootstrap 3. Want to use Bootstr

Zostera B.V. 2.3k Jan 02, 2023
Django Girls Tutorial Workshop

Django Girls Tutorial Workshop A log of activities during the workshop. this is an H2 git remote add origin https://github.com/ahuimanu/django_girls_t

Jeffry Babb 1 Oct 27, 2021
Django server-side adapter for Inertia.js

django-inertia Django server-side new adapter for Inertia.js. Getting Started Install the package pip install django-inertia Configure your project A

Samuel Girardin 14 Sep 16, 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
Probably the best abstract model / admin for your tree based stuff.

django-treenode Probably the best abstract model / admin for your tree based stuff. Features Fast - get ancestors, children, descendants, parent, root

Fabio Caccamo 360 Jan 05, 2023
A Django app to initialize Sentry client for your Django applications

Dj_sentry This Django application intialize Sentry SDK to your Django application. How to install You can install this packaging by using: pip install

Gandi 1 Dec 09, 2021