How to do it...

Go through the following steps to create a continuously scrolling page:

  1. First, add enough locations in the administration. As you can see from the Using HTML5 data attributes recipe, we will be paginating the LocationList view by 10 items per page, so we will need at least 11 locations to see whether the continuous scroll works as expected.
  2. Modify the template for the location list view as follows:
{# locations/location_list.html #}{% extends "base.html" %}{% load i18n static utility_tags %}{% block content %}    <div class="row">        <div class="col-lg-8">            <h1>{% trans "Interesting Locations" %}</h1>            {% if object_list %}                <div class="item-list">                    {% for location in object_list %}                        <a href="{{ location.get_url_path }}" class="item ...

Get Django 3 Web Development Cookbook - Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.