Matplotlib django images

I am looking for that I have an input form in which you can enter the server name and get several png images that are created from matpotlib.

I can create a form and write scripts that create image files. I am wondering what is the best way to handle images. Is there a way to show the resulting png file in a browser but not save it to disk?

You want to avoid cluttering up the catalog with the generated images after they are displayed in the browser. Should I just delete the image after rendering it?

0
source share
2 answers
response = HttpResponse(mimetype="image/png")
img.save(response, "PNG")
return response
+1
source

All Articles