I have been searching for solutions whole day.
How would I display image file in django template. I have already set
MEDIA_ROOT and MEDIA_URL.
assume a model:
Mymodel(models.Model):
photo = models.ImageField("somename",upload_to="images/")
get an instance:
myob = Mymodel.objects.get(pk=1)
in your template:
<img src="{% myob.photo.url %}">
--
regards
Kenneth Gonsalves
Senior Associate
NRC-FOSS at AU-KBC
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.