incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Marino <mmar...@gmail.com>
Subject Re: using python-cloudant to connect to couchDB
Date Thu, 20 Mar 2014 16:46:00 GMT
Hi radhika,

> Am 20.03.2014 um 17:33 schrieb "Ramanadham, Radhika" <radhika.ramanadham@emc.com>:
>
> Hi guys,
> I have a dumb question.
>
> Now with  cloudant, how do I connect to my couchDB server (http://localhost:5984)  with
no username and password?
>
> All the examples I see connect to cloudant and not couchDB. How do I connect to http://127.0.0.1:5984/
>
> import cloudant
>
> # connect to your account
> # in this case, https://garbados.cloudant.com
> USERNAME = 'garbados'
> account = cloudant.Account(USERNAME, async=True)

Call account with the uri key word variable:

Account(uri="http://localhost:5984")

>
> # login, so we can make changes
> future = account.login(USERNAME, PASSWORD)
> # block until we get the response body
> login = future.result()
> assert login.status_code == 200
>
> Thanks,
> Radhika

Mime
View raw message