.
is my project root, where manage.py
resides. I have a base template at ./templates/base.html
. I have a custom template tag in ./app/templatetags/mytags.py
from django import template
register = template.Library()
@register.unread_tag
def get_unread(user):
return user.notification_set.filter(viewed=False).count()
How do I make this tag usable for base.html, from which all app-level templates inherit.