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

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -