相关疑难解决方法(0)

Django - 引用模板中的静态文件

我在模板中引用静态文件时遇到了困难.我正在使用Twitter Bootstrap并将引导程序文件(css,img,js)放在mysite/static中.

我已经设置了STATIC_URL,STATIC_ROOTTEMPLATE_CONTEXT_PROCESSORS根据本教程.我已经运行./manage.py collectstatic了复制了72个文件.我还将以下模板标记添加到我的template(index.html)文件中,但这没有用.

{% load staticfiles %}
<link rel="stylesheet" href="{% static user_stylesheet %}" type="text/css" media="screen"/>
Run Code Online (Sandbox Code Playgroud)

任何有关如何引用文件的帮助,以便引导程序样式返回到模板将非常感谢!

python django static templates twitter-bootstrap

10
推荐指数
2
解决办法
2万
查看次数

标签 统计

django ×1

python ×1

static ×1

templates ×1

twitter-bootstrap ×1