Requires {% load static %}
Add {% load static %} near the top of any template that
uses {% static %}. Without it Django does not
know the name and raises TemplateSyntaxError.
Builds the URL for a file in your static files, so the path in the template stays correct when STATIC_URL changes or a storage backend adds a content hash.
Template
{% load static %}
<img src="{% static "img/logo.png" %}" alt="Logo">
Result
<img src="/static/img/logo.png" alt="Logo">
Hardcoding /static/… works right up until it does not: a CDN, a different prefix, or a hashed filename in production all break it, and this tag is the reason none of them are your problem.
