[Fixed]-How to add a python element directly to a <img> HTML element?

1👍

Do this instead

<img id="image" src ="{% static "polls/images/question_logos/" %}{{ question.question_logo }}.jpg"/>

👤Peter

0👍

You need to put quotes around the id attribute as well.
This should work perfectly.

<img id ="image" src ="{% static "polls/images/question_logos/{{ question.question_logo }}.jpg" %}"/>

Leave a comment