Hossein
Hossein

Reputation: 908

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

Upvotes: 11

Views: 9259

Answers (1)

ruddra
ruddra

Reputation: 51968

  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!!

Upvotes: 16

Related Questions