To resize images on upload (using PIL), I override the save method for my article model as follows:
def save(self): super(Article, self).save() if self.image: size = (160, 160) image = Image.open(self.image) image.thumbnail(size, Image.ANTIALIAS) image.save(self.image.path)
This works locally, but in production I get an error: NotImplementedError: this backend does not support absolute paths.
I tried replacing the line image.save with
image.save(self.image.url)
but then I get IOError: [Errno 2] There is no such file or directory: ' https://my_bucket_name.s3.amazonaws.com/article/article_images/2.jpg '
This is the correct image location. If I placed this address in the browser, the image will be there. I have tried many other things, but still no luck.
source share