On Apr 11, 1:21 pm, nai <chng.nai...@gmail.com> wrote:
> Is there anyway I can return the image like this `return
> render_to_response('template.html', {'graph': <graph generated by
> matplotlib or some other graphing package>}`

As noted, images are almost always loaded independently.  See, for
example, "Definition and Usage" of img tag here: 
http://www.w3schools.com/tags/tag_IMG.asp

If you would like to learn more about how to actually embed image in
the page, do a google search for Base64 data url.  The relevant rfc is
here: http://www.faqs.org/rfcs/rfc2397.html
Note that this is of extremely limited application:
1. It doesn't work in all browsers.
2. Due to url length limits it won't work for large images

If you generate an svg image, you can embed that directly into the
page in the fashion you have suggested.  Alas this also is not a cross
browser solution, but there are javascript/flash workarounds which may
suffice for you.  Take a look at SVGWeb http://code.google.com/p/svgweb/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to