Open wtemmerman opened 7 years ago
Actually I never played with django-imagekit and S3 in the last 3-4 years. There are some changes in boto
and the way how different 3th party storages works with boto
in order to upload files to S3
.
There was some issues related to boto3 (because of django-storages) and some people make it to work with django-s3-storage
but before django-s3-storage
started using boto3
. Currently I don't have any observations of how ImageKit interact with these storages.
You can prepare a PR in order to see what changes fixed the problem for you and if it is ok and do not break other code we can merge it.
Alright. Pull request #425 added.
I had the same problem and got the same error message. Your fix worked for me, however I don't know if there are any side effects. At least I haven't recognized any.
I am currently trying to switch from django-storages to django-s3-storage. While original file is stored at s3 correctly, the thumbnail is not created and not stored. The error I get is exactly the same as reported here.
@apiljic The PR is still open. I guess the bug is not fix in the repo. Did you try my fix ?
Yes. I just realized the PR is still open and edited my comment. I can confirm this error with:
django==1.11.12
django-imagekit==4.0.2
django-s3-storage==0.11.2
boto3==1.7.3
I haven't tested your solution yet. I need to try to understand what is going on. At the moment, I see an error with django-storages, like here: https://github.com/matthewwithanm/django-imagekit/issues/391
And the error you described with django-s3-storage. Can it be that both errors actually originate in boto3?
@wtemmerman After upgrading django-s3-storage to the latest version (0.12.4), this error has been gone for me.
I have an error if I tried to upload a file without name, on S3 storage. The error message is not important.
And when I upload a profile picture for users, I used
ProcessedImageField()
on my field picture. But in imagekit/utils.py, the functiongenerate()
(line 146) create a File object without name. In traceback I can see<File: None>
But when I update line 153 of
utils.py
From :f = File(content)
To :f = File(content, name=generator.source.name)
Upload finish perfectly.Maybe I miss something in S3 storage configuration, to accept File without name. I used django-s3-storage, last version, with boto3. Or do you want me to create a PR ?