turl1
, turl2
...ourl1
是ourl2
我从视图返回的上下文变量(所有字符串)。
{% for i in "1234" %}
<div class="spot">
{% with t="turl"|add:i %}
{% with o="ourl"|add:i %}
<a href= {{ o }}">
<img src={{ t }}>
</a>
{% endwith %}
{% endwith %}
</div>
{% endfor %}
现在我得到这个:
<a href="ourl1">
<img src="turl1">
</a>
...
whileourl1
并且turl1
应该评估为 url 但事实并非如此。