mysql - Display an image from the database in Django? -


i have read db don't have ability change. know extremely inefficient store images in database. don't have control on one. need display image field in database. how can in django?

  1. retrieve image database binary,
  2. write directly http response content (with stringio?),
  3. set relevant image mimetype/header

don't forget set content length in response. experiement 'streaming' if images huge.

https://docs.djangoproject.com/en/1.5/ref/request-response/#httpresponse-objects


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -