couchDB , python and authentication

前端 未结 6 1689
一整个雨季
一整个雨季 2021-02-04 11:44

I have installed couchDB v 0.10.0, and am attempting to talk to it via python from Couch class downloaded from couchDB wiki. Problem is:

Create database \'mydb\'         


        
6条回答
  •  一个人的身影
    2021-02-04 12:37

    Above are all nice; but I've found that for oauth validation methods versus basic auth, this works really well:

    from couchdb import Server, Session
    auth = Session()
    auth.name = USERNAME
    auth.password = PASSWORD
    s = Server('http://localhost:5984/', session=auth)
    db = s['dbname']
    

    Note: This will not work with basic authentication; in such a case, fviktor has what I consider to be the best answer. You might also look into the security reference material he linked to if you're interested in persistent auth sessions.

提交回复
热议问题