On Mon, 2010-10-25 at 03:34 -0700, d wrote:
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to