Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

627
Views
¿Cómo puedo cargar todo tipo de archivos (videos, audios, pdf, zip) en cloudinary en el modelo django? y como puedo borrarlos

modelos.py

 from django.db import models from cloudinary.models import CloudinaryField class File(models.Model): caption = models.TextField(blank=True) file = CloudinaryField() # trying to delete the File model and cloudinary file (error) def delete(self, *args, **kwargs): self.file.delete(*args, **kwargs) super().delete(*args, **kwargs)

configuración.py

 import cloudinary import cloudinary.uploader import cloudinary.api ... INSTALLED_APPS = [ '....', 'myapp', 'cloudinary', ] ... cloudinary.config( cloud_name = "...", api_key = "...", api_secret = "...", secure = True )

Solo puedo cargar imágenes, cuando intento cargar cualquiera (video, pdf, audio, zip) dice ARCHIVO DE IMAGEN NO VÁLIDO. y, a veces, se produce un error de tamaño de archivo cuando el tamaño de la imagen supera el límite de tamaño de 10 mb.

Este es el error al que me enfrento. (cuando traté de subir un archivo de video)

 Error at / Invalid image file Request Method: POST Request URL: http://127.0.0.1:8000/ Django Version: 3.2.9 Exception Type: Error Exception Value: Invalid image file Exception Location: C:\Users\MIG 29\Desktop\Project\testCloudinary\vEnv\lib\site-packages\cloudinary\uploader.py, line 522, in call_api Python Executable: C:\Users\MIG 29\Desktop\Project\testCloudinary\vEnv\Scripts\python.exe Python Version: 3.9.6 Python Path: ['C:\\Users\\MIG 29\\Desktop\\Project\\testCloudinary', 'c:\\users\\mig 29\\appdata\\local\\programs\\python\\python39\\python39.zip', 'c:\\users\\mig 29\\appdata\\local\\programs\\python\\python39\\DLLs', 'c:\\users\\mig 29\\appdata\\local\\programs\\python\\python39\\lib', 'c:\\users\\mig 29\\appdata\\local\\programs\\python\\python39', 'C:\\Users\\MIG 29\\Desktop\\Project\\testCloudinary\\vEnv', 'C:\\Users\\MIG ' '29\\Desktop\\Project\\testCloudinary\\vEnv\\lib\\site-packages'] Server time: Sun, 05 Dec 2021 06:14:04 +0000
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

gracias, acabo de encontrar la manera de cargar (imágenes, videos, audios) también... es así. en modelos.py

 file = CloudinaryField(resource_type='')
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!