title: django: return image data from a view
body: <p>I want a view to return image data. so something along the lines of</p>
  
  <pre><code>return HttpResponse(image_data, mimetype=”image/png”)
  </code></pre>
  
  <p>I know I can do a <code>file.read()</code> to get the image data, but because the image is small (like 1x1 px) I want to just store it as a string object (or whatever object I can copy and paste in my code). This way, I save myself the disk lookup everytime the view is hit.</p>
  
  <p>How do i go about this? I'm sure this is easy, I'm just not sure what terms to use for search.</p>
  
  <p>p.s. I know that one does not normally serve images this way with Django.</p>