【发布时间】:2012-10-19 02:20:20
【问题描述】:
我正在尝试在 Django 中使用 Twitter Bootstrap。我已经让它大部分工作了。 我有一个 profile.html 模板可以正确链接 CSS,但我有一个 user_timeline.html 模板没有预先添加 STATIC_URL。
user_timeline.html 确实扩展了具有 CSS 链接的 base.html。
在我的 profile.html 中,我得到了
<link href="/static//css/bootstrap.css" rel="stylesheet">
这可行,但在 user_timeline.html 我得到了
<link href="css/bootstrap.css" rel="stylesheet">
任何想法为什么它没有正确前置?
【问题讨论】:
-
你用
{{ STATIC_URL }}/css/bootstrap.css代替{{ STATIC_URL }}css/bootstrap.css吗? -
双“/”是实际输出还是只是一个错字?
-
双/是实际输出。但它仍然有效.. 无论如何这不是问题。
标签: python html css django twitter-bootstrap