I tried in your way to concatenate, I don't get any exception, but  the 
image image does'nt want to display. The plage only throw the "alt" value. 
Even for this line of code it's thing.


Le mardi 6 octobre 2015 19:51:04 UTC+2, Shawn Milochik a écrit :
>
> Try this:
>
> <img src="{% static 'pet/images/' + {{pet.name}} + '.png' %}" alt={{ 
> pet.name }} />
>
> You're embedding {{pet_name}} in a string. If this was a regular Python 
> statement, it would be like writing "Hello, {0}" and not having a format() 
> at the end.
>

-- 
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 post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f29da80b-ffe4-421c-9aba-8ad76b87a484%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to