Django raise ValueError("Must supply api_key")
Making my first steps with Django and Cloudinary ,I try to upload images.
After I open Admin and select the image I receive the error message:
ValueError: Must supply api_key
[23/May/2021 15:33:35] "POST /admin/simple_cloudinary/picture/add/ HTTP/1.1" 500 201463
Modles.py:
from django.db import models
from cloudinary.models import CloudinaryField
# Create your models here.
class Picture(models.Model):
image = CloudinaryField('image')
admin.py
from django.contrib import admin
from .models import Picture
admin.site.register(Picture)
settings.py:
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'cloudinary_storage',
'catalog.apps.CatalogConfig',
'blog.apps.BlogConfig',
'about.apps.AboutConfig',
'contact.apps.ContactConfig',
'homepage.apps.HomepageConfig',
'exhibitions.apps.ExhibitionsConfig',
'import_export',
'django_admin_inline_paginator',
'django_bootstrap_icons',
'simple_cloudinary',
'cloudinary',
STATIC_URL = '/static/'
MEDIA_URL = '/media/'
CLOUDINARY_STORAGE = {
# copied form dasshboard
'CLOUD_NAME': '------',
'API_KEY': '--------------',
'API_SECRET': '-----------------',
}
DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage'
As always any return is highly appreciated+many thanks
0
Post is closed for comments.
Comments
0 comments