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

后端 未结 13 1568
盖世英雄少女心
盖世英雄少女心 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:44

    I tried the following settings in django 2.1.1

    base.html

    
      {% load static %}
      
    
    

    settings.py

     STATIC_ROOT = os.path.join(BASE_DIR, 'static')
     STATIC_URL = '/static/'` 
    `.............

    Project directory structure

    view live here

提交回复
热议问题