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

Related searches

After upgrading to Django 3.0, I get the following TemplateSyntaxError:

In template /Users/alasdair//myproject/myapp/templates/index.html, error at line 1
'staticfiles' is not a registered tag library. Must be one of: admin_list admin_modify admin_urls cache i18n l10n log static tz

Here is my template

{% load staticfiles %}
<img src="{% static 'my_image.html' %}">

{% load staticfiles %} and {% load admin_static %} were deprecated in Django 2.1, and removed in Django 3.0.

If you have any of the following in your template:

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

You should replace the tag with simply:

{% load static %}

Templates | Django documentation, In the compilation stage, the TemplateSyntaxError exception will be raised if the template doesn't have proper syntax. Sample code: >>> from django import� TemplateSyntaxError is a class within the django.template.base module of the Django project. Example 1 from django-sitetree django-sitetree (project documentation and PyPI package information) is a Django extension that makes it easier for developers to add site trees, menus and breadcrumb navigation elements to their web applications.

django.template.base | Django documentation, TemplateSyntaxError: Invalid block tag on line 127: 'endblock', expected 'empty' or 'endthumbnail'. Did you forget to register or load this tag? It contains even� The following are code examples for showing how to use django.template.TemplateSyntaxError (). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like. Example 1

this worked with me replace {% load static from staticfiles %} with {% load static %}

where :

go to your virtual environment "venv" /lip/python3.X/site-packages/leaflet/templates/leaflet/admin/widget.html and all of the .HTML files in the directory

28050 (TemplateSyntaxError should contain template name) – Django, The following are 30 code examples for showing how to use django.template. TemplateSyntaxError(). These examples are extracted from open source projects. But if you look at it carefully, you will think the error message is very helpful and clear TemplateSyntaxError: Could Not Parse The Remainder. The error is because of the django static tag’s argument ‘css/dept_emp_style.css’, the single quote( ‘ ) is not an english charactor, instead it is a chinese charactor.

Python Examples of django.template.TemplateSyntaxError, Django TemplateSyntaxError: current transaction is aborted, what does this exception mean? Does postgresql 8.4 work fine with django? 3. Django templatetag User

This article will show how to solve the error message as it exist in the title of the article. The error message is ‘TemplateSyntaxError at / ‘staticfiles’ is not registered tag library’. The following image will show the detail of the error message : The error above appear upon executing the command to run Django-based web application.

If the template is found but contains invalid syntax, it raises TemplateSyntaxError. How templates are searched and loaded depends on each engine’s backend and configuration. If you want to restrict the search to a particular template engine, pass the engine’s NAME in the using argument. select_template(template_name_list, using=None)¶

Comments
  • Adding STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')] solved the issue. Before I was adding static file directory to DIRS inside templates which didn't work. Many thanks!
  • Changing files in site-packages is a bad idea. In your case, it would be better to upgrade django-leaflet to a newer version that supports Django 3.0+