Django TemplateSyntaxError - 'staticfiles' is not a registered tag library

Register staticfiles to tag library

staticfiles has been change to static

You can register with the fallowing code in your settings.py

Add this code in your TEMPLATES settings:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
            'libraries' : {
                'staticfiles': 'django.templatetags.static', 
            }
        },
    },
]

Note the you can find libraries witch you don't have it


If you have any of the following tags in your template:

{% load staticfiles %}
{% load static from staticfiles %}
{% load admin_static %}

Then replace it with:

{% load static %}

You have to make this change because {% load staticfiles %} and {% load admin_static %} were deprecated in Django 2.1, and removed in Django 3.0.