ANSWER

Quick answer

Store icon assets inside an application or project static directory, then collect them for production. Decide whether the web server will expose /favicon.ico directly or redirect that conventional request to STATIC_URL.

Last verified
July 31, 2026
Evidence
Primary documentation plus a route-specific implementation example
Primary sources
2
01

Project paths and constraints

Store icon assets inside an application or project static directory, then collect them for production. Decide whether the web server will expose /favicon.ico directly or redirect that conventional request to STATIC_URL.

Django’s staticfiles pipeline can rename assets through manifest storage. A conventional root /favicon.ico often needs a web-server alias, redirect, or explicit route outside STATIC_URL.

Connected next stepLaravel Favicon Guide: Public Files, Blade & Caching for the closest prerequisite or comparison.

02

Declare favicon metadata once

Use Django’s static template tag for hashed or storage-backed assets in the base template. A manifest containing relative paths must resolve against its own final URL, not the source directory.

Use the static template tag for storage-managed filenames. If clients also need /favicon.ico at the hostname root, expose that conventional route deliberately through the web server or a narrow application response.

Connected next stepFlask Favicons: Static Files, Root Routes and Proxies for the next connected implementation decision.

03

Build, deploy, and verify

Run collectstatic, inspect the storage output, and test through the production web server or CDN. The Django development server is not evidence that production static routing is correct.

A template URL can be valid while relative paths inside site.webmanifest are wrong. Resolve manifest icons from the manifest’s public location and test after collectstatic.

Connected next stepOpen the most relevant production tool and verify the decision with a working output.

04

Validate collectstatic, storage mapping, and proxy delivery

Run collectstatic with the production settings and inspect both the collected file and any manifest-storage mapping. Render the base template using those settings so the href reflects a fingerprinted CDN or STATIC_URL rather than a development path.

Fetch the generated static URL and the optional root ICO through the public proxy. Resolve every manifest icon relative to the manifest response URL, since browser resolution does not know where the Django source template lived.

05

Django static storage and root compatibility

Run collectstatic and inspect the storage-generated name when manifest or CDN storage fingerprints files. Template static URLs can use that mapping, while conventional /favicon.ico probes may still need a stable web-server alias or explicit root response.

Resolve manifest icon paths from the deployed manifest location, not the Django template directory. Test through the final storage domain and proxy because local static serving bypasses production storage behavior.

BUILD

Production file tree and code: Django staticfiles template mapping

The static tag follows the active storage backend and any fingerprinted name created by collectstatic. A root ICO needs a separate server alias or narrow response when required.

FILE TREE
project/
├── static/icons/favicon.svg
├── static/icons/favicon.ico
└── templates/base.html
DJANGO
{% load static %}
<link rel="icon" href="{% static 'icons/favicon.svg' %}" type="image/svg+xml">
<link rel="icon" href="{% static 'icons/favicon.ico' %}">
DOWNLOADABLE EVIDENCE

Review the headings, sources, implementation artifact, and update record for this guide as structured JSON.

Download guide evidence ↓
Evidence scope
Guide
Django Favicon Guide: Static Files, Routes & HTML
Coverage
Client behavior can change by browser, operating system, platform version, cache state and deployment configuration. Unperformed manual observations are not claimed.
Q&A

Questions, answered

Should Django redirect /favicon.ico to STATIC_URL?+

It can, though a direct web-server alias avoids an extra request. Whichever method you choose must return a public icon response rather than a login page or HTML shell.

Why do manifest icons fail when the template icon works?+

The template tag resolves HTML URLs, but relative manifest src values resolve from the manifest's own public URL. Test those paths separately after collectstatic.