You would add this code to the views.py file, which is where the business logic goes.
Likely would add a class with properties and methods or a definition (a function) like below:
For example in your apps views.py file:
def connect_to_dropbox():
dbx = dropbox.Dropbox('your access token)
dbx.users_get_current_account()
# this stuff likely would go in a separate function
for entry in dbx.files_list_folder('').entries:
print(entry.name)
At some point in your code you would call the function:
connect_to_dropbox()
On Wed, Jun 12, 2019 at 3:10 PM omar ahmed <omarkadytt@gmail.com> wrote:
i opened the documentation for django-storages ... and i installed Dropbox in my environment and i created my app folder but i didn't complete docs .
somethings not clear ... like :Link an account
dbx = dropbox.Dropbox('YOUR_ACCESS_TOKEN')where should i write these commands ?dbx.users_get_current_account()Try some API requests
for entry in dbx.files_list_folder('').entries: print(entry.name)
thanks
On Wednesday, June 12, 2019 at 1:13:11 AM UTC+2, James Farris wrote:You might try the docs from DropboxYou can checkout this project for ideasand here is documentation for django-storagesOn Tue, Jun 11, 2019 at 2:17 PM omar ahmed <omark...@gmail.com> wrote:yes James you are right.... i need to upload images using the Django admin, ... how can i use Dropbox for this issue ?
i need a good tutorial
On Tuesday, June 11, 2019 at 6:14:10 PM UTC+2, James Farris wrote:He is saying these aren't static files. It sounds like he uploads them using the Django admin, which of course is like an end user on a client uploading files to the media directory.
Since that is the case it sounds like the Dropbox option is the best. Documentation was provided earlier. So being that it seems like he read through the documentation, my question is where is he stuck in the Dropbox implementation?----
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/8O8BS7DhF30/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3d50f417-cceb-4141-9b6d-9d2f5d0feee4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/8O8BS7DhF30/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e8763fdb-d559-4d5b-9274-a59c7c0e9198%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
James Farris
Web Application Developer | Web and Digital Solutions
External Relations & Advancement Marketing Communications
University Development and Alumni Relations | UC Berkeley
University Development and Alumni Relations | UC Berkeley
510-664-4512 | jfarris@berkeley.edu
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMdMWAXKSRpKu6BA%2BzZSETp6sd6yN3WL7NnYVm%2BCxYKgN3ogBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment