Load a Django template tag library for all views by default

There is an add_to_builtins method in django.template.loader. Just pass it the name of your templatetags module (as a string).

from django.template.loader import add_to_builtins

add_to_builtins('myapp.templatetags.mytagslib')

Now mytagslib is available automatically in any template.

Leave a Comment