I am getting used to using python-cloudant for authenticated access to Cloudant databases but want to do unauthenticated access from a Python script.  I set up unauthenticated read access to one of the databases for my account and can read documents fine using curl without authentication but I don't know how to do this using python-cloudant.  I've tried using (None, None), ("nobody", "none"), even some credentials that I use for databases for a completely different account but get denied access.
            Asked
            
        
        
            Active
            
        
            Viewed 263 times
        
    1
            
            
        
        John
        
- 309
 - 2
 - 11
 
2 Answers
2
            
            
        You could use the CouchDB client and set admin party mode. That way you don't need to specify credentials in the client constructor.
    from cloudant.client import CouchDB
    client = CouchDB(None, None, url='https://user.cloudant.com', admin_party=True, connect=True)
    db = client['mydb']  # my world readable database
    print db.doc_count()
See the docs for more info.
        Sam Smith
        
- 31
 - 2
 
0
            I think I got the right combination. I don't know what I was doing earlier but when I authenticate with a valid API key & access token, I got access even though the API key doesn't have explicit access to the database.
        John
        
- 309
 - 2
 - 11