I need to concatenate two strings inside a static tag, i checked previous question about how to concatenate strings in django template and i found this answer, but when i used that solution, the broser (Firefox) doesn't show the image.
Details: This is my code, assume that the value of user.if is 1:
{% with "images/my_twitter_wordcloud_"|add:user.id|add:".png" as image_static %}
<center>
<img src="{% static 'image_static' %}" width="650" height="350" style="margin-left: 10%;"/>
</center>
{% endwith %}
When i ckecked the inspector in the browser, it showed the image like this:
<img src="/static/image_static" style="margin-left: 10%;" height="350" width="650">
I think that it should be:
<img src="/static/images/my_twitter_wordcloud_"|add:user.id|add:"png" style="margin-left: 10%;" height="350" width="650">
I checked the django documentation about add reference, and i tried using "" and "" after add, but It seems like django doesn't interpretate the variable, what i'm doing wrong?
Thanks for your help. PD: i'm apologyze for my English.
Edit: Doing what @Selcuk said, the inspector show me this:
<img src="/static/.png" style="margin-left: 10%;" height="350" width="650">
Is strange, even if i use '' instead of "", so i don't understand what is wrong, if i put this (where the value of user.id is 1):
<center><img src="{% static 'images/my_twitter_wordcloud_1.png' %}"
It show the image correctly.