4
我有一個存儲爲二進制blob圖像的模型。我想在模板中顯示此圖像以及有關該對象的其他數據。由於圖像不是一個單獨的文件,我無法弄清楚如何顯示它。我嘗試設置標題,或使用send_file
或render_template
,但我要麼沒有得到圖像或只有獲得圖像,而不是模板的其餘部分。如何在模板中將二進制blob顯示爲圖像?在模板中以二進制blob存儲的顯示圖像
class A(ndb.Model):
id= ndb.IntegerProperty()
x= ndb.StringProperty()
y= ndb.StringProperty()
image = ndb.BlobProperty()