Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Django navbar package

Project description


Code style: black coverage report

A code based navbar with great ambitions.



django-bootstrap-navbar lets you create a bootstrap 4 navbar with a Python class. It then takes care of setting the active class on the appropriate link based on the current path.


The library is available on PyPi.

pip install django-bootstrap-navbar

Once you have created a navbar class there are two ways of making it available in your template context:

  1. Using the provided context processor
BOOTSTRAP_NAVBAR = "showcase.navbar:ExampleNavBar"

        "BACKEND": "django.template.backends.django.DjangoTemplates",
            "context_processors": [
  1. Using the provided mixin
class ContextProcessorView(BootstrapNavBarViewMixin, TemplateView):
    template_name = "index.html"
    navbar_class = AppNavBar

Finally the navbar can be rendered within your templates by calling the navbar.render method.

{{ navbar.render }}

A full example is available within the repo.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-bootstrap-navbar, version 0.0.22
Filename, size File type Python version Upload date Hashes
Filename, size django_bootstrap_navbar-0.0.22.tar.gz (9.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page