Skip to content
New issue

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

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

Already on GitHub? # to your account

How to use CloudinaryField to accept images/url from other sources? #233

Open
abkiran opened this issue Feb 25, 2020 · 2 comments
Open

How to use CloudinaryField to accept images/url from other sources? #233

abkiran opened this issue Feb 25, 2020 · 2 comments
Assignees
Labels

Comments

@abkiran
Copy link

abkiran commented Feb 25, 2020

I used Django package cloudinary==1.19.1

models.py

class Category(models.Model):
    name = models.CharField(max_length=255)
    url = models.CharField(max_length=255)
    image = CloudinaryField(null=True)
    image_source=models.CharField()

I want to use the image field to accept images that uploaded from admin, also some of my background tasks add the image URLs to that field depends on the image_source.

Possible image sources are: Google, Facebook, cloudinary or CloudFront

For example: When the image source is from google, I just want to save the complete image URL() instead of uploading the actual image to cloudinary and saving the id

How do I achieve this?

@brian-cloudinary @const-cloudinary @cloudinary @CloudinaryLtd

@lukitsbrian lukitsbrian self-assigned this Feb 26, 2020
@lukitsbrian
Copy link
Contributor

@abkiran Are you running into an issue with your current implementation? It seems like what you have should work since you have a url field and a nullable image field for Cloudinary images.

@abkiran
Copy link
Author

abkiran commented Feb 27, 2020

@brian-cloudinary
url field is to store the auto generated slug,

My question was can I store the image URL of different source in to the image field

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

No branches or pull requests

2 participants