{% static %} Tag

builds a URL for a static file.

Utility Most Useful As Markdown

Argument(s)
path
Closing tag
Not required
Requires
{% load static %}

Documentation

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.

More Utility Tags

All Utility Tags


Did we get something wrong? Is there a use case for the static tag that we should add? Please let us know.

Send Feedback

Official Documentation
This page last updated on August 20, 2026