Skip to main content

Django navhelper

Build status

Django template tags to add active class on navigation menus

Prerequisites

  • Django 4.2

  • Python 3.10

Installation

From sources

python setup.py install

From PyPi

pip install django-navhelper==1.0

Configure your Django installation

Add geelweb.django.navhelper in your INSTALLED_APPS.

Template tags

navactive

Returns “active” if url name of the current request path is in the list of view names

{% load navactive %}
<li class="{% navactive request "view_name app_name:another_view_name namespace:" %}">
    <a href="{% url "view_name" }">Menu Entry</a>
</li>

renavactive

Returns “active” if the pattern is found in the request path

{% load navactive %}
<li class="{% renavactive request "^/start_with_foo" %}">
    <a href="{% url "view_name" }">Menu Entry</a>
</li>

Settings

You can customize some options using settings

NAVHELPER_ACTIVE_CLASS

Default: ‘active’

The class name for active entries

NAVHELPER_NOT_ACTIVE_CLASS

Default: ‘’ (Empty string)

The class name for non-active entries

Run test suite

To run the test suite, first, create and activate a virtual environment. Then install some requirements and run the tests:

pip install Django==4.2
python runtests.py

Metadata

Release files for django-navhelper 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-navhelper 1.0.0
File Size Uploaded Provenance Actions
django-navhelper-1.0.0.tar.gz 4.4 kB Without provenance Details for django-navhelper-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-navhelper 1.0.0
File Interpreter ABI Platform Actions
django_navhelper-1.0.0-py3-none-any.whl Python 3 none any Details for django_navhelper-1.0.0-py3-none-any.whl

Total release size: 9.0 kB

Release files / django-navhelper-1.0.0.tar.gz

Download URL django-navhelper-1.0.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ea7bf447187e23566db11daccbf87693dff410c7d0b036c9397c8f1c0bf7d6f6
BLAKE2b-256 checksum
How to use checksums
6ff880c86f01c3b5c2d96e587a4be8358988fd59b278dd37922bef5531e30285
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Release files / django_navhelper-1.0.0-py3-none-any.whl

Download URL django_navhelper-1.0.0-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2062fda7799a5bb8d7aadb9750702ff6afa45f5f485a48b84c6ff4cca6a8678c
BLAKE2b-256 checksum
How to use checksums
1b01ab5bfcc0382f92520a5e974d34cfdcce49744862ad751a4a6c5158dcca77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.1 CPython/3.11.4

Security for django-navhelper 1.0.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.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page