In the view.py I have a list like this:
context['cities'] = ['London', 'Beijing', 'Cape Town', ..]
I don't know why I can't substitute substring in string in the following Html
code:
{% for city in cities % }
<di style="background-image: url({% static 'app/img/{{city}}.jpg' %});">
{% endfor %}
I expect something like app/img/London.jpg
.
in inspect what I see is this string:
url(/static/app/img/%7B%7Bcity%7D%7D.jpg);