[rrd-users] display graphs generated with python bindings in html
clemens_weninger at gmx.net
Tue Dec 15 10:18:55 CET 2009
On Tuesday 15 December 2009 00:55:26 Michael P. Soulier wrote:
> On 15/12/09 Jean-Yves Avenard said:
> > You should have a look at the pylons framework ; which let you do
> > stuff like that quite easily.
> > Otherwise, you can't modify html headers directly, as least not as
> > easily as with PHP
> If this is Django then I must disagree. Modifying the headers is trivial.
> I would not rely on rrdtool to send http headers, capture the output of
> rrdtool in a buffer in memory, and then customize your response object in
> response = HttpResponse(mimetype="image/jpg")
> return response
> Not really an rrdtool question though.
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:
rrdtool.graph('-', <further options>) # that should go into buffer
response = HttpResponse(mimetype="image/jpg")
but that goes directly to stdout. I tried to redirect stdout to a buffer but I
couldn't get it to work.
More information about the rrd-users