当我打开我的页面我在我的终端以下消息:我的Django项目没有加载引导glyphicons
Not Found: /fonts/glyphicons-halflings-regular.woff2
[24/Aug/2016 17:19:36] "GET /fonts/glyphicons-halflings-regular.woff2 HTTP/1.1" 404 2238
Not Found: /fonts/glyphicons-halflings-regular.woff
[24/Aug/2016 17:19:36] "GET /fonts/glyphicons-halflings-regular.woff HTTP/1.1" 404 2235
Not Found: /fonts/glyphicons-halflings-regular.ttf
我home_page代码,我加载此glyphicon高于:
{% load staticfiles %}
<link rel="stylesheet" type="text/css" href="{% static 'bootstrapmin.css' %}"/>
<link rel="stylesheet" type="text/css" href="{% static 'style.css' %}" />
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<a class="navbar-brand" href="">
<span class="glyphicon glyphicon-log-out" aria-hidden="true"></span> 
<button class="btn-link" type="button"> OntoLogica</button>
</a>
</div>
</nav>
我的引导文件是:
- 我的项目文件夹
- 静态文件夹
- bootstrapmin.css
- 的style.css
- Fonts文件夹
- 以下是文件Django的找不到
- 静态文件夹
我已经尝试做的事:
- 移动字体文件夹的自举
- 的同一路径下的文件移动字体的静态文件夹之外文件夹。
如果您需要我没有提供的任何信息,请问,我会。 伙计们,什么是错的?预先感谢任何帮助!
你运行过'./manage.py collectstatic'吗?此外,“我的项目文件夹”是一个应用程序的文件夹,还是它真的是您的项目中的顶级文件夹?如果它是一个应用程序,您可以尝试使用'“{%static'my_project_or_app/bootstrapmin.css'%}”'而不是仅仅使用'“{%static'bootstrapmin.css'%}”'。 – elethan
是的,我运行了collectstatic。我的项目文件夹是顶级项目。命令“{%static'bootstrapmin.css'%}”工作正常,因为我可以访问引导程序命令,例如navbars等。特定情况下不起作用的是glyphicon。是什么有关没有找到我认为的字体和svg文件。 –