how to render images from database in django code example
Example 1: display data from database in django
data = Students.objects.all()
stu = {
"student_number": data
}
return render_to_response("login/profile.html", stu)
{% for student in student_number %}
{{ student.f_name}}
{{ student.l_name }}
{{ student.student_number }}
{{ student.dob }}
{% endfor %}
Example 2: how to display image in html from json object
for (var i = 0; i < boldStuffs.length; i += 1) {
var fruit = getRandomItem(fruitsArray);
boldStuffs[i].innerHTML = fruit.name + '<img src="'+fruit.image+'">';
}