Reputation: 25552
I am trying to use the cloudant
python library (http://cloudant-labs.github.io/cloudant-python/) in a Flask
application but I can't see where you would use API keys to connect to your cloudant account
I tried this:
import cloudant
account = cloudant.Account('account_name')
login = account.login('public_key', 'private_key')
But it doesn't do anything
Upvotes: 1
Views: 482
Reputation: 187
not cloud ant but raw code
import requests
import json
#basic authentication
auth = ('account', 'private_key')
post_url = "https://account_name.cloudant.com/database".format(auth[0])
r = requests.put(post_url, auth=auth)
print json.dumps(r.json(), indent=1)
Upvotes: 0
Reputation: 188
It looks like you posted this to github. I wanted others to be able to find the answer.
https://github.com/cloudant-labs/cloudant-python/issues/43:
import cloudant
account = cloudant.Account(USERNAME, auth=(API_KEY, API_SECRET))
Upvotes: 2