On Thu, Jun 16, 2022 at 4:09 AM luca72.b...@gmail.com <luca72.bertolo...@gmail.com> wrote: > > Hello i have a list like: > mylist = ['1,png','2.png',3.jpj'] > in the template i do as follow: > {% for o in mylist %} > <ul> > {% if "png" in o %} > {{ o }} > <li><img width="770" height="1500" alt="" src="{% static > "polls/{{o}}" %}" class=""></li> > {% else %} > <li>{{o}}</li> > </ul> > {% endif %} > {% endfor %} > in the template i see the file name but it never render, if i loock the > source code i see that in the <img tag i have this line > <li><img width="770" height="1500" alt="" src="/static_files/polls/%7Bo%7D" > class=""></li> > So i never get the correct file name. > How is the correct way to get the name of the variable o inside the img tag > Thanks
mylist has 1,png not 1.png ^ Could that be the issue? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACwCsY7j%2BRAqTN15MLtAch3f2JbC8-h_nL3o1rE0%2Br06THLm8Q%40mail.gmail.com.