Can anyone help me on how to add a logo to the index bar in Django-admin site?
3 Answers
You should probably override (by extend) the app_index.html
admin template.
So you need to create a template/admin
directory in your application and override the correct template by adding you own logo.
[Edit]
Oh sorry, you screenshot was too small and I just realized that you’re talking about the icon in the tabbar. That would be the favicon. For that, it’s simple, just add a favicon.ico
into your static/
folder, and serve that directly from your http server (probably with a alias).
You can also serve the file directly using a simple view, but that doesn’t seems like a good idea except in development.

- 2,356
- 1
- 21
- 29
-
Sorry for the small image – Oct 12 '20 at 08:13
-
can you guide me on how to add a `favicon.ico` – Oct 12 '20 at 08:14
-
I think we should override base_site.html for logo addition – Oct 12 '20 at 08:23
Your Question is answered here. You have to override Django base.html template and put it under the admin directory.

- 95
- 4
- 16
Override the Django base.html template and put it under the admin directory like my_app/templates/admin/base.html
Add {% block extrahead %}
to the overriding template.
{% extends 'admin/base.html' %}
{% load staticfiles %}
{% block javascripts %}
{{ block.super }}
<script type="text/javascript" src="{% static 'app/js/action.js' %}"></script>
{% endblock %}
{% block extrahead %}
<link rel="shortcut icon" href="{% static 'favicon.ico' %}" />
{% endblock %}
{% block stylesheets %}
{{ block.super }}
{% endblock %}