1

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

1
  • what error do you get (e.g. when you do assert login.status_code == 200)? Commented Jun 6, 2014 at 8:48

2 Answers 2

2

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))
Sign up to request clarification or add additional context in comments.

Comments

0

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)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.