网格图标在我的开发服务器中呈现为空矩形。
设置
from unipath import Path
BASE_DIR = Path(__file__).ancestor(2)
STATICFILES_DIRS = (BASE_DIR.child("static", "static_dirs"), )
STATIC_URL = '/static/' 模板
{% load staticfiles %}
<span class="glyphicon glyphicon-heart"></span>
<span class="glyphicon glyphicon-calendar"></span> bootstrap.css/bootstrap.min.css
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('../fonts/glyphicons-halflings-regular.woff') format('woff'),
url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),
url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');urls
urlpatterns = patterns('',
url(regex = r'^$',
view = 'tesglyph.views.testglyph'),
) + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)当我加入
base.html
<head>
(...)
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-glyphicons.css" rel="stylesheet">(...)
</head>我得到了心,但没有日历!
我该怎么解决这个问题?
发布于 2014-09-28 16:48:07
这似乎太难了,你考虑过像django-bootstrap3这样的东西吗?
所有需要的都是-
{% load bootstrap3 %}
...
{% bootstrap_icon "heart" %}请注意,此解决方案意味着您只在模板中编写代码,从而节省了大量的麻烦。用要显示的引导图标名称替换heart。就这样。
https://stackoverflow.com/questions/26087134
复制相似问题