Could someone show some example about using dropbox api with django?
Dropbox api is installed, readme is done, tests are done, how to go further?
Could someone show some example about using dropbox api with django? Dropbox api is
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you need to understand, how oauth works.
Consider the use-case, when you are trying to store uploaded files directly on user’s dropbox account.
First of all, you have to register a developer account on dropbox site.
In your django views, a typical workflow is this:
ask dropbox for a request token, (it
notifies them that you will use
their api soon)
dba = auth.Authenticator(app_settings.CONFIG)request_token = dba.obtain_request_token()than you build an authentication url:
authorize_url = dba.build_authorize_url(request_token, callback='http://...'you use the request token to get an
access token, it’s now unique to the
user.
access_token = dba.obtain_access_token(request_token, 'verifier')here you are! you should instantiate a client, it’s defined
in the python-specific dropbox
package
drpbx_client = client.DropboxClient('server','content_server','port',dba,access_token)the client is a helper object for file operations:
drpbx_client.put_file('dropbox', '/porn/', request.FILES['file'])