Another way to solve the problem is: through src="/img/{{xx.image field.grid_id}}/"
Defined as a public View
Get the actual image stored through GridFS through the passed string objectid and output
from flask import Response
from bson.objectid import ObjectId
from mongoengine import *
app.route('/img/<oid>/')
def get_img(oid=None):
if oid:
proxy = GridFSProxy(grid_id=ObjectId(oid))
return Response(proxy.read(),mimetype='image/jpeg')
Another way to solve the problem is: through src="/img/{{xx.image field.grid_id}}/" Defined as a public View Get the actual image stored through GridFS through the passed string objectid and output
nginx+mongodbgridfs plug-in. No?
Similarly applies to other encodings and formats, but note that older browsers do not support this method.