Wednesday, June 12, 2019

Re: my file uploads missing/deleted

This python package may be a better choice for you, since I assume you want all user generated content (images) to be stored in Dropbox. 

This has pretty good documentation. 
If you use this package, remove the sample code I sent


On Wed, Jun 12, 2019 at 3:53 PM omar ahmed <omarkadytt@gmail.com> wrote:
i added this function at the end of views.py file
def connect_to_dropbox():
    dbx = dropbox.Dropbox('your access token)
    dbx.users_get_current_account()
and i put given access token from dropbox
then what about call
do you mean in any view function that will show page included images add 
connect_to_dropbox()
and what about

for entry in dbx.files_list_folder('').entries:      print(entry.name)



On Thursday, June 13, 2019 at 12:38:11 AM UTC+2, James Farris wrote:
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 <omark...@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')
dbx.users_get_current_account()

Try some API requests

for entry in dbx.files_list_folder('').entries:      print(entry.name)
where should i write these commands ?
thanks


On Wednesday, June 12, 2019 at 1:13:11 AM UTC+2, James Farris wrote:

On 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...@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/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
510-664-4512 | jfa...@berkeley.edu


--
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/4f99e57d-ec92-4336-abda-37f671e188c6%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
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/CAMdMWAUXJBE4gHeEU_8TuKwRVqCq2toG-aLaGv0k6wupQajgxg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment