Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document client-side uploading #10

Open
skorokithakis opened this issue Oct 8, 2017 · 3 comments
Open

Document client-side uploading #10

skorokithakis opened this issue Oct 8, 2017 · 3 comments

Comments

@skorokithakis
Copy link

Hello!

I am currently using django-cloudinary-storage with the naive, server-uploading method, where the user uploads the photo to the server and the server uploads it to Cloudinary. That works fine, but soon I will switch to client-uploaded images, where the user uploads the image directly to Cloudinary and then sends me the URL (or whatever Cloudinary returns).

Could some documentation be added to detail how I can support this method? What do I need to give Django to create these fields and how?

@skorokithakis
Copy link
Author

It seems like the way to do this is to just assign the final Cloudinary path to the ImageField:

my_model.image = "media/imagefile"
my_model.save()

@klis87
Copy link
Owner

klis87 commented Oct 9, 2017

@skorokithakis Exactly. If you use any Django storage, file upload must go through Django. If you want to upload directly to cloudinary, then you actually won't use Django storage for uploading at all. However, you will still benefit from it, for example by utilizing delete-orphaned-media command to clean unnecessary files.

Is everything working fine with your method? Do you think we should add this to documentation?

@skorokithakis
Copy link
Author

Yes, everything seems to be working great so far. I think it should be added, yes, as I imagine many people will be using client-side uploading and the fix is so simple that I don't see why not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants