Я работаю над проектом Django и столкнулся со следующей ошибкой при попытке загрузить в свой шаблон собственный фильтр шаблона:
'custom_filters' is not a registered tag library. Must be one of:
admin_list
admin_modify
admin_urls
cache
i18n
l10n
log
static
tz
Структура моей папки:
stream/
├── templatetags/
└── __init__.py
└── custom_filters.py
├── templates/
└── index.html
Мой index.html:
{% load custom_filters %}
Newspaper results
// HTML CODES
мой custom_filters.py:
from django import template
register = template.Library()
@register.filter
def get_item(dictionary, key):
return dictionary.get(key)
Подробнее здесь: https://stackoverflow.com/questions/789 ... ag-library