Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

this is a very special question. Currently I'm starting to develop a new online shop using Python (Flask). I want to use CouchDB to store (and sync) new orders. But CouchDB does not encrypt the replication as far as I know.

Is it possible to use Python to get authentication with OAuth an start a replication via https://couchdb.one.ubuntu.com between CouchDB and the UbuntuOne Server?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Yes. Desktopcouch does replication between a CouchDB (on your desktop) and https://couchdb.one.ubuntu.com, and that will work from any CouchDB; the CouchDB that desktopcouch runs is not something special.

To start a replication between a CouchDB of your choice and Ubuntu One, use the Couch replication API:

POST /_replicate HTTP/1.1

{
  "source":"example-database",
  "target":{
    "url": "https://couchdb.one.ubuntu.com/u%2Fabc%2Fdef%2F123456%2Fexample-database",
    "auth": {
      "oauth": {
        "consumer_key": "xxx",
        "consumer_secret": "xxx",
        "token": "xxx",
        "token_secret": "xxx"
      }
    }
  } 
}

You can find example code which actually kicks off this replication from Python in couchdb_io.py in the desktopcouch tree.

share|improve this answer
    
Great, thanks. I guess, this will help –  burli Feb 12 '11 at 12:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.