I have a small Django project I received from a friend. The code works perfectly on his system. However, on my system I get the following error message when running the serv
For others facing this . Suppose your App name is MyApp
and your tag folder name is templatetags
then in settings.py
you should have :
INSTALLED_APPS = [
'MyApp',
'MyApp.templatetags'
]
Both your django app and your tag folder which is under your app package are needed there.
-> MyApp
---> models.py
---> views.py
---> templatetags
-----> __init__.py
-----> app_filters.py
And in your template file :
{% load app_filters %}
Also app_filters.py
be like :
# coding=utf-8
from django import template
register = template.Library()
@register.filter(name='get_item')
def get_item(dictionary, key):
return dictionary.get(key)
check all above steps and you may find the issue.