>>> couch = couchdb.Server('http://127.0.0.1:5984/')
>>> couch.create('test1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 204, in create
self.resource.put(validate_dbname(name))
File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 989, in put
**params)
File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 1035, in _request
raise ServerError((status_code, error))
couchdb.client.ServerError: (401, ('unauthorized', 'You are not a server admin.'))
если просто написать традиционным способом admin:pass то выдает ошибку:
>>> couch = couchdb.Server('http://admin:123@127.0.0.1:5984/')
>>> couch.create('test1')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 204, in create
self.resource.put(validate_dbname(name))
File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 989, in put
**params)
File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 1014, in _request
resp, data = _make_request()
File "/usr/lib/pymodules/python2.6/couchdb/client.py", line 1009, in _make_request
body=body, headers=headers)
File "/usr/lib/python2.6/dist-packages/httplib2/__init__.py", line 1129, in request
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/lib/python2.6/dist-packages/httplib2/__init__.py", line 901, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, headers)
File "/usr/lib/python2.6/dist-packages/httplib2/__init__.py", line 865, in _conn_request
raise ServerNotFoundError("Unable to find the server at %s" % conn.host)
httplib2.ServerNotFoundError: Unable to find the server at admin:123@127.0.0.1
При этом все операции на чтение нормально работают то есть проблема с авторизацией.