Created
February 2, 2012 14:55
-
-
Save aabril/1723829 to your computer and use it in GitHub Desktop.
connect and create a couch database from python code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # import | |
| from couchdb.client import Server | |
| # connection | |
| server = Server('http://localhost:5984') | |
| server.resource.credentials('username','password') | |
| # create a database | |
| db = server.create('mycouchdb') | |
| # create a document | |
| db['foo']= dict(bar="bar", 'fighters'= 1337 ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment