This bundle provides two features:
To use the couchdb bundle add its setup function during application setup, like so:
from glashammer.bundles.couchdbdb import setup_couchdb
def setup_app(app):
app.add_setup(setup_couchdb)
This will add the bundle using the default url of http://localhost:5984, and a mount point of /couch for the proxy. These default values can be overridden on adding the setup function, and later overriden by configuration variables:
from glashammer.bundles.couchdbdb import setup_couchdb
def setup_app(app):
app.add_setup(setup_couchdb, 'http://localhost:5984', '/couchdb')
The server instance is available to the request on the thread local instance by calling the get_couchdb_server() function:
from glashammer.bundles.couchdbdb import get_couchdb_server
def my_view(req):
# Get the server instance
server = get_couchdb_server()
# Now do something with it
server.create('my_db')
API:
Setup callable arguments: