set favicon in django admin

前端 未结 4 1709
醉酒成梦
醉酒成梦 2021-02-18 14:08

I need to set up a favicon for django admin interface.

It would be best to do it globally, without overriding templates for all apps.

What is the cleanest way

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-18 14:18

    Extend admin/base.html in your template/admin/base_site.html template and add the favicon link in extrahead block

    {% extends "admin/base.html" %}
    {% load staticfiles %}
    ...
    {% block extrahead %}
        
    {% endblock %}
    

提交回复
热议问题