title: Creating dynamic images with WSGI, no files involved
body: <p>I would like to send dynamically created images to my users, such as charts, graphs etc. These images are "throw-away" images, they will be only sent to one user and then destroyed, hence the "no files involved".</p>
  
  <p>I would like to send the image directly to the user, without saving it on the file system first. With PHP this could be achieved by linking an image in your HTML files to a PHP script such as:</p>
  
  <p>edit: SO swallowed my image tag:</p>
  
  <pre><code>&lt;img src="someScript.php?param1=xyz"&gt;
  </code></pre>
  
  <p>The script then sent the correct headers (filetype=>jpeg etc) to the browser and directly wrote the image back to the client, without temporarily saving it to the file system.</p>
  
  <p>How could I do something like this with a WSGI application. Currently I am using Python's internal SimpleWSGI Server. I am aware that this server was mainly meant for demonstration purposes and not for actual use, as it lacks multi threading capabilities, so please don't point this out to me, I am aware of that, and for now it fulfills my requirements :)</p>
  
  <p>Is it really as simple as putting the URL into the image tags and handling the request with WSGI, or is there a better practise?</p>
  
  <p>Has anyone had any experience with this and could give me a few pointers (no 32Bit ones please)</p>
  
  <p>Thanks,</p>
  
  <p>Tom</p>