【发布时间】:2013-03-28 18:10:31
【问题描述】:
所以我通过views.py 传递一个变量
return render_to_response(html, {'file': file})
进入我的html
<img src="{% static "{{file}}" %}" alt="My image"/> working
但是该文件在我的 html 中没有响应。谁能帮帮我。
【问题讨论】:
-
就像@GarethRees 所说,文件已经在模板标签范围内可用,所以不要使用括号也会发布您的实际错误。 (html代码)