PLS HELP ME TemplateSyntaxError at /

After runserver i got this

TemplateSyntaxError at /

‘blog_tags’ is not a registered tag library. Must be one of: admin_list admin_modify admin_urls cache i18n l10n log mptt_admin mptt_tags static tz

blog / templatetags / blog_tags.py

from django import template
from ..models import Category

register = template.Library()

@register.simple_tag
def total_categories():
    category_list = Category.objects.filter(published=True, )
    return category_list 

I’m trying to solve this problem about 3days pls help me

1 Like

Hi @thisisfuckingalex

First, welcome to the forum. Please consider changing your username to something more polite in line with the code of conduct.

For your template tag - did you read the guide? Do you have an __init__.py file? Can you import the module in the shell fine?

>>> from blog.templatetags import blog_tags
>>> blog_tags.total_categories()

Is blogs in INSTALLED_APPS ?