def photo_service(id): try: u = Photo.query().filter(Photo.filename == id).fetch()[0] if u: response = make_response(u.file) response.headers['Content-Disposition'] = 'attachment; filename=%s'%u.filename response.headers['Content-Type'] = "image/jpg" return response except Exception as e: print e return "Blob not found"
def listPhotos(): try: u = Photo.query().fetch() return render_template("listphotos.html", photos=u) except Exception as e: return e