Django: problems while loading custom filters in the base template file while using template inheritance
问题 When doing the {% load custom_filters %} in the template, after {% extends "base.html" %} everything works fine, but when I move the load to the base.html template the filter gets a weird behaviour. This is my custom_filters.py : from django import template from django.template.defaultfilters import stringfilter register = template.Library() # To cut off strings at a specified character, at first occurance. Example: # time = 19:30:12.123456 # {{ time|cut:'.' }} # returns: 19:30:12 @register