added support for couchdb
using current_user from flask login