How to display image in template

103 views
Skip to first unread message

Ram Ganesh

unread,
Jun 27, 2014, 4:33:21 AM6/27/14
to django...@googlegroups.com
I started learning Django and I'm trying to build a photo app.
this app merging uploaded images and rendering.
I have merged Images with PIL and save the image in accessible file system.

Now I'm stuck with this,
 -How do I displaying merged new Image,
 -How to serve merged new Image files in my Templates?
Can some one show a step by step instruction

Application running on django development server.

Phang Mulianto

unread,
Jun 27, 2014, 5:01:04 AM6/27/14
to django-users
Hi,

The image i assume you upload to media folder . 
Make sure your media folder accessible by webserver which serving static files.

To use in template just use the html img src='urltoimage'  , and use media_url context variable to not hardening the url.

Mulianto

http://muliantophang.blogspot.com




--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/912a0115-080f-4e01-9c2e-c7253a940fd0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages