DEV Community

Ashutosh Mishra
Ashutosh Mishra

Posted on

Unable to get images on excel sheet using OPENPYXL package Django

I am creating an api to get images from django model to excel sheet.I am using openpyxl package.But bY GET operation on postman getting only the url of the image.

models.py

class Task(models.Model):

Id=models.IntegerField()
Name=models.CharField(max_length=50,null=False,blank=True)
Image1=models.FileField(blank=True, default=""
 upload_to="media/images",null=True)
Image2=models.FileField(blank=True, default="",
 upload_to="media/images",null=True)
Date=models.DateField(null=True,blank=True)

def __str__(self):
    return str(self.Name)

view.py

class TaskViewSet(viewsets.ViewSet):

def

Top comments (0)