Cloudinary unknown API key
Hello, odd thing occurring.
I have set the API Key as an environment variable in DJANGO using a separate folder(to avoid uploading to github) and i am able to access it using PRINT from settings.py (CLOUD_NAME works perfectly so next is API Key which causes the following..)
The API key is the EXACT one on my dashboard, I get this as an error:
Request Method: | POST |
---|---|
Request URL: | http://127.0.0.1:1234/admin/Campaigns/campaign/add/ |
Django Version: | 4.0.6 |
Exception Type: | Error |
Exception Value: |
Unknown API key ************ (* in place of my api key) |
0
-
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.titledef 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_assignsuper().save(*args, **kwargs)0 -
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,
Thomas0
Post is closed for comments.
Comments
2 comments