I try to use the static template template tag in one of my templates, but I get an exception that I don't understand.
Here is the template code:
<img src="{{STATIC_URL}}closed.png" alt="Closed message" /> <br/> {% load static %} <img src="{% get_static_prefix %}closed.png" %}" alt="Closed message"/> <br/> <img src="{% static "closed.png" %}" alt="Closed message"/>
The first two image display instructions work if I comment on the last. When the last one is uncommented, I get an exception:
Invalid block tag: 'static'
The code is based on this section of the django documentation.
chmike
source share