I'm tying to get an image attachment from couchdb using flask & python then pass the image to imgurl.html to be displayed.
The problem is that I'm only get this:
couchdb.http.ResponseBody object at 0x103b9c0b8> returned.
app.py
from flask import Flask, request, render_template, flash, request, url_for, redirect
import couchdb
import requests
app = Flask(__name__)
couch = couchdb.Server('http://127.0.0.1:5984/')
db = couch['test2']
doc = db.get_attachment('2', 'aboutme.jpg', default=None)
print("doc: ", doc)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/imgurl/')
def imgurl():
return render_template('imgurl.html'