base.html is used as the base template for all other pages. base.html has the navigation bar and in the navigation bar, I want to show the number o
base.html
You can use tags.
#myproject/myproject/templatetags/tags.py from django import template register = template.Library() @register.simple_tag def number_of_messages(request): return _number
In your Base.html
{% load tags %} {% number_of_messages request %}