I'm working on a project and for ACID compliancy reasons, images are stored in the database. I'm running flask/jinja/SQLAlchemy. I have images going to an images table, in a largebinary column. Upon calling images from the database I get a bunch of "gibberish" as output. Snippets of code below. I'm using a for loop to display images from the database in jinja but not working as expected.
image = request.files['new_image']
new_image= Images(creationdatetime=now, image=image.read())
db.session.add(new_image)
db.session.commit()
and in html/jinja
{% for image in images%}
<li><img src="{{image.image}}"></li>
{%endfor%}
with regards to displaying logic:
images=Images.query.all()
return render_template('/admin/index.jinja2', images=images)
I get a bunch of gibberish. A new record is created in postgres, checked through psql. Any suggestions?