I am having a Django HTML page. I would like to display an image in an HTML file. I am returning like this.
in views.py
params = {
'obj': obj,
'data':data,
}
return render_to_string('records/record.html', params), obj
In html file
<img src="{{data.image.path}}">
While logging what I am getting data.image.path like this
In Django html page it replacing & to &.
CodePudding user response:
Try changing {{data.image.path}}
to {{data.image.url}}