Python 如何通过txcouchbase进行身份验证?

Python 如何通过txcouchbase进行身份验证?,python,python-3.x,couchbase,Python,Python 3.x,Couchbase,我通过bucket=bucket(“couchbase://localhost/users“,但由于服务器有用户名和密码,如何进行身份验证?我将从开始。在撰写本答复时,即: from couchbase.cluster import Cluster from couchbase.cluster import PasswordAuthenticator cluster = Cluster('couchbase://localhost') authenticator = PasswordAuthen

我通过
bucket=bucket(“couchbase://localhost/users“
,但由于服务器有用户名和密码,如何进行身份验证?

我将从开始。在撰写本答复时,即:

from couchbase.cluster import Cluster
from couchbase.cluster import PasswordAuthenticator
cluster = Cluster('couchbase://localhost')
authenticator = PasswordAuthenticator('username', 'password')
cluster.authenticate(authenticator)
cb = cluster.open_bucket('bucket-name')
我会从这个开始。在撰写本答复时,即:

from couchbase.cluster import Cluster
from couchbase.cluster import PasswordAuthenticator
cluster = Cluster('couchbase://localhost')
authenticator = PasswordAuthenticator('username', 'password')
cluster.authenticate(authenticator)
cb = cluster.open_bucket('bucket-name')

这不是使用txcouchbase。我需要异步版本。不过,谢谢你的回答!这不是使用txcouchbase。我需要异步版本。不过,谢谢你的回答!