How can I get a favicon to show up in my django app?

后端 未结 13 1584
盖世英雄少女心
盖世英雄少女心 2020-12-02 06:50

I just want to drop the favicon.ico in my staticfiles directory and then have it show up in my app.

How can I accomplish this?

I ha

13条回答
  •  心在旅途
    2020-12-02 07:40

    Best practices :

    Contrary to what you may think, the favicon can be of any size and of any image type. Follow this link for details.

    Not putting a link to your favicon can slow down the page load.

    In a django project, suppose the path to your favicon is :

    myapp/static/icons/favicon.png
    

    in your django templates (preferably in the base template), add this line to head of the page :

    
    

    Note :

    We suppose, the static settings are well configured in settings.py.

提交回复
热议问题