Skip to main content

Django Active View: Highlight active items in menu

PyPi MIT TravisCI Coverage Updates Supported Python implementations Supported Python versions

Introduction

Django template tag that checks if given view or path is active.

Installation

  • Supported Python versions are: 2.7, 3.4, 3.5, 3.6 and pypy.

  • Supported Django versions are: 1.8.x, 1.9.x, 1.10.x and 1.11.x.

pip install --upgrade django-activeview

Add activeview to INSTALLED_APPS:

INSTALLED_APPS = [
    # ...
    'activeview',
    # ...
]

Usage

Template tag isactive accepts name of url OR path.

{% load activeview %}

{% isactive "/" %}
    Root path ("/") is active
{% endisactive %}

Or:

{% isactive "index" %}
    Url with name "index" is active
{% endisactive %}

Else is supported:

{% isactive "contact_us" %}
    Url with name "contact_us" is active.
    {% else %}
    "contact_us" is NOT active
{% endisactive %}

Inspiration and Credits

License

The MIT License (MIT)

Copyright (c) 2016–2017 Vašek Dohnal (@illagrenan)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Metadata

Release files for django-activeview 0.1.3

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-activeview 0.1.3
File Size Uploaded Provenance
django-activeview-0.1.3.tar.gz 4.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-activeview 0.1.3
File Interpreter ABI Platform
django_activeview-0.1.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 13.2 kB

Release files / django-activeview-0.1.3.tar.gz

Download URL django-activeview-0.1.3.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
c7339a97cb643860a688c84fa584320dcea7e0bd47d10c1d4965fc8870133ce4
BLAKE2b-256 checksum
How to use checksums
0d721fa697eae1a19335f7ffb7a12c32020a2be6c9fb3a79149fcda473399643
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_activeview-0.1.3-py2.py3-none-any.whl

Download URL django_activeview-0.1.3-py2.py3-none-any.whl
Size 8.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
908c0fc20624c016a8fb80dc822de695a6466f94e1d38e473fc952147b488ef0
BLAKE2b-256 checksum
How to use checksums
91f74d6e968f846976870c06ced82a564a19ac566506fe8112ea1f7a2e5f14b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-activeview 0.1.3

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.

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