[rrd-users] display graphs generated with python bindings in html

Michael P. Soulier msoulier at digitaltorque.ca
Tue Dec 15 12:35:49 CET 2009


On 15/12/09 Clemens Weninger said:

> Hi,
> ok thanks for that tip, I can easily modify the headers now. But a problem 
> that remains is how to get the image in the buffer?
> I would like to call:
> 
> #!/usr/bin/python
> import rrdtool 
> 
>  rrdtool.graph('-', <further options>)  # that should go into buffer
> 
> response = HttpResponse(mimetype="image/jpg")
> response.write(buffer)
> return response
> 
> but that goes directly to stdout. I tried to redirect stdout to a buffer but I 
> couldn't get it to work.

Can you pass the option an alternate file object? If so pass it a cStringIO
object. 

Mike
-- 
Michael P. Soulier <msoulier at digitaltorque.ca>
"Any intelligent fool can make things bigger and more complex... It takes a
touch of genius - and a lot of courage to move in the opposite direction."
--Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20091215/9af222d6/attachment.pgp 


More information about the rrd-users mailing list