I want to pass a variable from python Django and use it inside the <img>
tag. How can I do it?
Here is my code.
Python-
render(request, 'dashboard/dashboard.html', {"variable_int" : 12})
HTML
<img src="{% static "img/icons/vendor/yahoo_weather/{{variable_int}}.gif" %}" /></td>
I know that I need to pass it between {{}}
but I'm not getting the image. How can I do it?
<img>
tag, then it is<img src="/static/img/icons/vendor/yahoo_weather/%7B%7Bvariable_int%7D%7D.gif" />
– python-coder Nov 14 '13 at 10:47static
. – the5fire Nov 14 '13 at 10:55