1

I have a label "Inactive sites" in my django admin:

class InactiveSite(Site):
    class Meta:
        proxy = True
        verbose_name_plural = 'Inactive sites (' + str(Site.objects.filter(is_active=False).count()) + ')'

I would like to format "Inactive sites" (change color, font size, etc.). How can I do that?

jundymek
  • 1,013
  • 4
  • 18
  • 40

1 Answers1

1

You can override Django's template for the admin page and include your own css file (preferred way) or directly add it to the html.

You can use the developer tools of chrome or firefox to identify what selector you need. In Chrome CTRL+SHIFT+C and then click on the link text. At the moment I only have a modified admin, for me the css selector is: #admin-home > ul > li > ul > li > a

See here: https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#overriding-admin-templates

The answer here has a code sample: https://stackoverflow.com/a/37317429/640916

Community
  • 1
  • 1
djangonaut
  • 7,233
  • 5
  • 37
  • 52