django-page-tours
Guided tours of a page for Django sites, shown with Driver.js.
A new visitor to an application often can't tell what a page is for or where its important controls are. A short tour fixes that: a few steps, each pointing at one part of the page with a sentence about it. Building one by hand means wiring a JavaScript library into templates, writing the steps in JavaScript far from the view they describe, and remembering who has already seen it. django-page-tours moves the steps into Python, next to the page, and handles the rest.
Status: alpha. Every feature on the roadmap is in place, and the API may still change before 1.0.
Scope & philosophy
What it is. A tour belongs to one page. A developer declares its steps in Python, each one pointing at an element on the page with a title and a short description. The first time someone opens the page, the tour plays. They can step through it, skip it or close it, and once they have seen it, their browser remembers and it does not play again unless they ask for it. When the tour changes enough to matter, the developer gives it a new version, and people who saw the old one see the new one once.
What it deliberately is not.
- Not a design. The package ships Driver.js's own styling, in the lowest cascade layer on the page, and nothing more. A site gives the tour its look with its own CSS.
- Not a store of progress per account. Whether someone has seen a tour is kept in their browser. The package adds no database tables.
- Not tours across several pages.
- Not dependent on a CDN. Driver.js ships inside the package, so a tour works on a site with a strict content security policy or no outside network access.
When a choice is close:
- Lean on Driver.js for anything it already does, rather than reimplementing it.
- A tour that fails must leave the page exactly as usable as it was without one.
- Fewer settings beat more. Each one has to earn its place.
Quickstart
pip install django-page-tours
Add page_tours to INSTALLED_APPS.
Include the package's stylesheet and scripts once, in the <head> of your base template:
{% load static %}
<head>
...
<link rel="stylesheet" href="{% static 'page_tours/page-tours.css' %}">
<script src="{% static 'page_tours/vendor/driver.js-1.11.0/driver.js.iife.js' %}" defer></script>
<script src="{% static 'page_tours/page-tours.js' %}" defer></script>
</head>
On a page with no tour they do nothing.
Declare a tour and put it in a view's context, like any other value:
from django.views.generic import TemplateView
from page_tours import Tour, TourStep
DASHBOARD_TOUR = Tour(
name="dashboard",
steps=[
TourStep(title="Welcome", description="A quick look around."),
TourStep(title="Projects", description="Your work is here.", element="#projects"),
],
)
class DashboardView(TemplateView):
template_name = "dashboard.html"
extra_context = {"tour": DASHBOARD_TOUR}
Output it in the page's template, dashboard.html:
{% extends "base.html" %}
{% block content %}
<ul id="projects">...</ul>
{{ tour }}
{% endblock content %}
{{ tour }} outputs the tour's steps, the way {{ form.media }} outputs a form's assets, and
the package's script plays them over the page.
The tour plays the first time a browser opens the page, and not again in that browser, which
remembers it by its name. A function-based view passes the tour in the context it renders with:
render(request, "dashboard.html", {"tour": DASHBOARD_TOUR}).
To let visitors play it again, place a button of your own marked data-page-tour-replay on the
page. The package's script makes it start the tour:
<button type="button" class="btn" data-page-tour-replay>Show the tour</button>
Tour mirrors Driver.js's configuration object, so a tour sets Driver.js options as fields named
as Driver.js names them, such as Tour(showProgress=True). See the
Driver.js configuration reference for each option.
Options that take a function are not available.
The package also puts hints on a page: markers a visitor opens in any order and dismisses for good
in their browser. Hints declares them, and {{ hints }} renders them. See the
documentation.
It also puts a checklist on a page: a panel of items a visitor works through, each starting a
tour, opening a page or ticked by the app, with the visitor's ticks kept in their browser.
Checklist declares it, and {{ checklist }} renders it. See the
documentation.
A project can replace the tour of an installed app, or turn it off, from its own settings with
PAGE_TOURS_OVERRIDES, keyed by the tour's name, without editing the app. It can also word the
buttons and progress text of every tour, set of hints and checklist at once with
PAGE_TOURS_TEXT, which a tour, hints or checklist that sets its own text overrides.
The documentation covers naming a tour, function-based views, steps attached to elements, tour versions, replaying a tour and tours that play only on request, tours from reusable apps, Driver.js options, styling, and translation.
Styling
Every part of a shown tour step has a documented class name: page-tour-box, page-tour-title,
page-tour-text, page-tour-progress, page-tour-previous, page-tour-next, page-tour-done,
page-tour-close and page-tour-highlight. Style them from your own stylesheet, or give parts
classes of your own with the PAGE_TOURS_CLASSES setting. A design system installed as an app
can supply classes for the parts as defaults with AppConfig.page_tour_classes, and the project's
setting replaces them part by part. Django's check command reports a wrong entry with
page_tours.W003 or page_tours.W004. The
styling page
has the details.
Requirements
- Python 3.12 or 3.13
- Django 5.2, 6.0 or 6.1
Prior art
| Package | Why it isn't this |
|---|---|
| django-tour | No release since 2015 |
| django-driverjs | No release since 2022, no licence |
| django-tours | Built on Shepherd.js, which is AGPL-licensed. Loads its script from a CDN and keeps tours in the database |
Licence
MIT. Driver.js is also MIT-licensed.
Metadata
Release files for django-page-tours 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_page_tours-0.3.0.tar.gz | 49.0 kB | With provenance | Details for django_page_tours-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_page_tours-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for django_page_tours-0.3.0-py3-none-any.whl |
Total release size: 121.2 kB
Release files / django_page_tours-0.3.0.tar.gz
| Download URL | django_page_tours-0.3.0.tar.gz |
|---|---|
| Size | 49.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
36e77a79aa42f32b19605e73f34f25adfb4e0cb68f62ddccf1006d09ca640a14
|
|
BLAKE2b-256 checksum How to use checksums |
f4702f400112646c005a0f5fa2d274a32033796df707646364708b66d3604f6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logRelease files / django_page_tours-0.3.0-py3-none-any.whl
| Download URL | django_page_tours-0.3.0-py3-none-any.whl |
|---|---|
| Size | 72.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f823f9bad739bc2182d4050b0bfd6629e9dadc99ea56577fb021d6de3d3e34c
|
|
BLAKE2b-256 checksum How to use checksums |
702bc27821de1280233cd900abc1da3b52cb661727389de1eaa8917441f70a63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logSecurity for django-page-tours 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for django_page_tours-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.