About Favicon for Django Admin

To add a favicon to Django administration page, create a template file admin/base_site.html with the following content:

1
2
3
4
5
{% extends "admin/base_site.html" %}

{% block extrahead %}
    {% include "misc/includes/favicon.html" %}
{% endblock %}

Then create a template file misc/includes/favicon.html with one or more favicon image versions:

1
2
{% load static %}
<link rel="shortcut icon" href="{% static 'site/img/favicon.ico' %}" />

You can use online favicon image generators to generate different versions of your favicon for different platforms and use cases based on your logo.

Tips and Tricks Development Django 4.2 Django 3.2 Django 2.2