Django backend not resolv custom template tags.

Hi there. I have encountered such a problem. I started learning django. I have created templatetag dir in my django app as python module and in this with following contents:
tag_register = template.Library()
def hostList(id=None):
if id:
hosts = Hosts.objects.get(id=id)
hosts = Hosts.objects.all()
return hosts
tag_register.simple_tag(hostList, ‘hostlist’)
But when i heve started debug webserver, i had following errors:
‘inventory_tags’ is not a registered tag library.
The application has been added to the INSTALLED_APPS list in
I can’t figure out what the problem is. I need help.

second temlatetags in project level i have created later, for test.

I think that should “templatetags” you’re missing the p there.

1 Like