首页 > 解决方案 > 部署时网站图标不显示

问题描述

我在 Pythonanywhere 上部署了一个 Django 网站。favicon 在我的本地服务器上工作,但不在我的 Pythonanywhere 站点上。

我的 base.html 中的代码是

<link rel="stylesheet" type="text/css" href="{% static 'fixtureapp/style.css' %}">
<link href="{% static 'images/scc.ico?' %}" rel="icon" type="image/x-icon" />

我已经展示了样式表链接,因为它正在工作,所以静态设置好了。iamges/scc.ico 在同一个静态文件中。

我得到错误

2021-03-10 14:52:43,422:未找到:/favicon.ico

标签: djangopythonanywheredjango-staticfiles

解决方案


推荐阅读