[Solved]-Django registration of tag library not working


I faced this problem to.what i did was just stop the server run and just run it again.It seems that django does not initialize tags (or resources in general) while running the server.hope it helps.


According to django documentation:

Development server won’t automatically restart after adding the templatetags module, you will need to restart your server before you can use the tags or filters in templates.

So, to resolve the issue, you need restart development server.

Source: https://docs.djangoproject.com/en/3.0/howto/custom-template-tags/#code-layout


Just for a reminder, when using django under Windows, it is necessary to restart the development server (python.exe manage.py runserver) in at least two situations, which are:

  • when a new templatetag was created in an app
  • when static files were modified in the ‘app/static/app/’ folder

Hope this helps


I faced the same problem, but reloading the server doesn’t work.
So I solved it by this:

at project/setting.py I wrote the next, at TEMPLATE I registered libraries:

    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': [os.path.join(BASE_DIR, 'templates'), ],
    'APP_DIRS': True,
    'OPTIONS': {
        'context_processors': [
        'libraries': {
            'my_tags': 'app.templatetags.blog_tags',


And the server restarted by itself.


In Django 3.1 i solved it putting my py file inside templatetags folder inside my app. As the docs said. custom template tags.
The py file must have register = template.Library()


in settings i have myapp inside INSTALLED_APPS array

Then in my template file

{% load mytags %}

Leave a comment