I have a line of code <img src="{% static 'mysite/plots/' %}{{ plot }}" alt="Stock price vs. predictions graph" style="width: 600px; height: 450px;">
where I want to display images based on a variable called plot
that I pass from my views.py. For example, this variable could be 'AAPL.PNG' or 'TSLA.PNG', whatever the image name is, I am sure that I have it stored at my static/mysite/plots/ directory because when I access these paths directly with {% static 'mysite/plots/AAPL.PNG' %}
it works.
I have also tried:
src="{% static 'mysite/plots/{{ plot }}' %}"
src="{% static 'mysite/plots/'(plot) %}"
src="{% static 'mysite/plots/' + plot %}"