Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I change the default font using in django admin interface?

I wanna know how can I change the default font using in django admin interface?

Brgds

like image 895
Hossein Avatar asked Nov 03 '18 07:11

Hossein


1 Answers

  1. Create a folder name admin in your template directory.
  2. Create a file named base_site.html in there.
  3. Create a css file in your static directory. for example: override.css, where you might put the code for changing font:

     p {
      font-family : "Fira Code"
     }
     h1 {
      font-family: "Fira Code"
     }
    
  4. Now update the base_site.html like following:

    {% extends 'admin/base_site.html' %}
    
    {% load static %}
    
    {% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% static 'override.css' %}" />{% endblock %}
    

The override.css will change the fonts of p and h1 across admin site. Modify override.css according to your need. Hope it helps!!

like image 81
ruddra Avatar answered Nov 07 '22 11:11

ruddra