add favicon in django admin

  1. Create a directory named "static" inside your Django app's main directory.
  2. Inside the "static" directory, create another directory named "admin".
  3. Place your favicon file (e.g., favicon.ico) inside the "admin" directory.
  4. Create a file named "base.html" inside the "templates/admin" directory if it doesn't exist.
  5. Add the following code to the "base.html" file:
{% load static %}
{% block extrahead %}
<link rel="icon" type="image/x-icon" href="{% static 'admin/favicon.ico' %}" />
{% endblock %}
  1. Save the changes and restart your Django server.