django-crumbs
django-crumbs is a pluggable Django app for adding breadcrumbs to your project.
Installation
Install django-crumbs with pip:
pip install django-crumbs
Add to your INSTALLED_APPS and run syncdb:
INSTALLED_APPS = ( ..., 'crumbs', )
How It Works
In each template, you’ll need to use the add_crumb template tag to append items to the trail:
# basic crumb without a link {% add_crumb 'People' %} # crumb with link {% add_crumb 'People' 'list_people' %} # crumb with link and args {% add_crumb person.name 'view_person' person.pk %}
Note: no bread crumbs will be printed if only one call to add_crumb has been made.
Setup
In your base.html template, add something along the lines of the following code:
<div id="breadcrumbs"> {% block breadcrumb %} {% load breadcrumb_tags %} {% add_crumb 'Home' 'home' %} {% endblock %} {% render_breadcrumbs %} </div>Now in each extended child template, simply add a new crumb to the trail in the breadcrumb block:
{% block breadcrumb %} {{ block.super }} {% load breadcrumb_tags %} {% add_crumb 'People' 'list_people' %} {% endblock %}
Example
base.html:
<div id="breadcrumbs"> {% block breadcrumb %} {% load breadcrumb_tags %} {% add_crumb 'Home' 'home' %} {% endblock %} {% render_breadcrumbs %} </div>person/list.html:
{% extends "base.html" %} {% block breadcrumb %} {{ block.super }} {% load breadcrumb_tags %} {% add_crumb 'People' 'list_people' %} {% endblock %}person/view.html:
{% extends "person/list.html" %} {% block breadcrumb %} {{ block.super }} {% load breadcrumb_tags %} {% add_crumb person.name 'view_person' person.pk %} {% endblock %}
Development sponsored by Caktus Consulting Group, LLC.
Metadata
Release files for django-crumbs 0.5.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-crumbs-0.5.0.tar.gz | 3.5 kB | Without provenance | Details for django-crumbs-0.5.0.tar.gz |
Release files / django-crumbs-0.5.0.tar.gz
| Download URL | django-crumbs-0.5.0.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61cfa5bb8791fd83cff7158c0740ea1d6ab3ee6046c3118c187368e3b4b51208
|
|
BLAKE2b-256 checksum How to use checksums |
16ff0f06da398b968c60d52f90905e8da5c9cc873645bdf62828367daaa6fb2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-crumbs 0.5.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.