4
我有一个存储为二进制blob图像的模型。我想在模板中显示此图像以及有关该对象的其他数据。由于图像不是一个单独的文件,我无法弄清楚如何显示它。我尝试设置标题,或使用send_file
或render_template
,但我要么没有得到图像或只有获得图像,而不是模板的其余部分。如何在模板中将二进制blob显示为图像?在模板中以二进制blob存储的显示图像
class A(ndb.Model):
id= ndb.IntegerProperty()
x= ndb.StringProperty()
y= ndb.StringProperty()
image = ndb.BlobProperty()