I\'ve created a custom tag that I want to use, but Django can\'t seem to find it. My templatetags directory is set up like this:
pygmentize
For Django 2.2 up to 3, you have to load staticfiles in html template first before use static keyword
{% load staticfiles %}
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
For other versions use static
{% load static %}
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
Also you have to check that you defined STATIC_URL in setting.py
At last, make sure the static files exist in the defined folder
I had the same problem, here's how I solved it. Following the first section of this very excellent Django tutorial, I did the following:
python manage.py startapp new_appsettings.py file, adding the following to the list of INSTALLED_APPS: 'new_app',new_app package named new_app_tags.{% extends 'base_template_name.html' %}: {% load new_app_tags %}new_app_tags module file, create a custom template tag (see below).{% multiply_by_two | "5.0" %}Example from step 5 above:
from django import template
register = template.Library()
@register.simple_tag
def multiply_by_two(value):
return float(value) * 2.0
did you try this
{% load games_tags %}
at the top instead of pygmentize?