Registry / web-framework / django-navhelper

django-navhelper

JSON →
library1.0.0pypypiunverified

Provides Django template tags to help render navigation menus and breadcrumbs from a hierarchical structure of sections. Version 1.0.0 requires Django 4.2+ and drops support for older Django versions. Released as needed, currently stable.

pip install django-navhelper
INSTALL
IMPORT
SIG · DJANGO-NAVHELPER
D
django-navhelper
web-frameworkpythonv1.0.0
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

NavHelper
from geelweb.django import NavHelper
from geelweb.django import NavHelper

Set up a Section model with parent hierarchy, add 'navhelper' to INSTALLED_APPS, then use the navhelper_menu template tag to render a nested menu.

# settings.py INSTALLED_APPS = [ ... 'navhelper', ] # models.py from django.db import models from navhelper import NavHelper class Section(models.Model): title = models.CharField(max_length=100) slug = models.SlugField() parent = models.ForeignKey('self', null=True, blank=True, on_delete=models.CASCADE) url = models.CharField(max_length=200, blank=True) def __str__(self): return self.title # urls.py from django.urls import path from . import views urlpatterns = [ path('', views.home, name='home'), path('section/<slug:slug>/', views.section_detail, name='section_detail'), ] # template.html {% load navhelper %} <ul> {% navhelper_menu sections %} </ul>
Debug
Known issues
breakingVersion 1.0.0 drops support for Django versions older than 4.2. Upgrade your Django version to 4.2+ before updating.
fix
Ensure Django >= 4.2 is installed: pip install 'django>=4.2'
affects: <1.0.0 to 1.0.0
gotchaThe template tag expects a queryset or list of objects with 'parent' and 'children' attributes. Ensure your model has foreign key to self and a method/attribute for children (e.g., via prefetch_related).
fix
Use a model like Section with parent ForeignKey and define a 'children' property or use reverse relation. Example: prefetch_related('section_set') and set children attribute manually.
affects: all
gotchaThe navhelper_menu tag may not automatically handle active state. You might need to pass 'current' parameter or implement custom logic for highlighting current section.
fix
Check documentation for 'current' argument in template tag usage.
affects: 1.0.0
Upgrade
Version history
1.0.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies
djangorequiredRequired for template tags and ORM.
Agent activity
4 hits · last 30 days
node
4
Resources
django-navhelper — pip install django-navhelper · libregistry