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?
- retrieve image database binary,
- write directly http response content (with stringio?),
- 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
Post a Comment