I have installed couchDB v 0.10.0, and am attempting to talk to it via python from Couch class downloaded from couchDB wiki. Problem is:
Create database \'mydb\'
The Couch
class in the example does not pass any authentication information to the database, so it is not a miracle that it does not allow privileged operations. So your only options are:
Authorization
HTTP request headerIf you want to pass a user name and a password, then you will need to change the Couch
class. Sending an Authorization
HTTP request header is easier, since the Couch class uses the httplib.HTTPConnection
class. You can add such a header next to the Accept
one this way:
headers = {
"Accept": "application/json",
"Authorization": "Basic " + 'username:password'.encode('base64')[:-1]}
Same for the other HTTP request methods.
The documentation on the basic authentication is here:
http://books.couchdb.org/relax/reference/security