clone of https://bitbucket.org/leafstorm/flask-couchdb