Skip to main content

Cloudinary unknown API key

Comments

2 comments

  • Chris
    This is my Django/Python Model



    class
    Campaign(models.Model):
        title = models.CharField(max_length=200)
        descriptin = models.TextField()
        slug = models.SlugField(max_length=200, null=True, blank=True)
        created_at = models.DateTimeField(auto_now_add=True)
        updated_at = models.DateTimeField(auto_now=True)
        logo = CloudinaryField('image', overwrite=True, format="jpg")
        #Cloudinary has a model field that it ships with

        class Meta:
            ordering = ('-created_at',)
       
        def __str__(self):
            return self.title
       
        def save(self, *args, **kwargs):
            to_assign=slugify(self.title)

            if Campaign.objects.filter(slug=to_assign).exists:
                to_assign=to_assign+str(Campaign.objects.all().count())

            self.slug=to_assign
            super().save(*args, **kwargs)
    0
  • Thomas Gurung

    Hi Chris,

    Thank you for reaching out. 

    Could you please clarify what you mean by setting the API Key as an environment variable in DJANGO using a separate folder? If possible, can you show me how exactly you're creating these environment variables (redacted)? 

    The recommended way to define Cloudinary credentials is via:

    export CLOUDINARY_URL=cloudinary://<API-KEY>:<API-SECRET>@<CLOUD-NAME>
     
    The CLOUDINARY_URL value is available in the [dashboard of your Cloudinary account](https://cloudinary.com/console).
     
    We also have a sample Django project here if you'd like to check it out.
     
    If you prefer you can open a ticket over https://support.cloudinary.com as well if you need to send us sensitive information.
     
    I'm looking forward to your response.

    Kind Regards,
    Thomas
     
    0

Post is closed for comments.