You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm currently using django-storages in conjunction with Amazon S3 to upload images from a Django application running on Heroku. I added the setting vars as per the docpage here, which leads to an error saying to use AWS4-HMAC-SHA256 when trying to do python manage.py collectstatic.
Using sdeleeuw's instructions here changes the request to use v4 authentication, but now it's giving me a SignatureDoesNotMatch error. However, I can perfectly upload files with boto3 with my current credentials and with v4 authentication in a script like this:
Here is my output log which doesn't really tell much of a story
File "C:\Users\sleibrock\AppData\Local\Programs\Python\Python35\lib\site-packages\boto3\s3\inject.py", line 509, in object_upload_fileobj
ExtraArgs=ExtraArgs, Callback=Callback, Config=Config)
File "C:\Users\sleibrock\AppData\Local\Programs\Python\Python35\lib\site-packages\boto3\s3\inject.py", line 427, in upload_fileobj
return future.result()
File "C:\Users\sleibrock\AppData\Local\Programs\Python\Python35\lib\site-packages\s3transfer\futures.py", line 73, in result
return self._coordinator.result()
File "C:\Users\sleibrock\AppData\Local\Programs\Python\Python35\lib\site-packages\s3transfer\futures.py", line 233, in result
raise self._exception
File "C:\Users\sleibrock\AppData\Local\Programs\Python\Python35\lib\site-packages\s3transfer\tasks.py", line 126, in __call__
return self._execute_main(kwargs)
File "C:\Users\sleibrock\AppData\Local\Programs\Python\Python35\lib\site-packages\s3transfer\tasks.py", line 150, in _execute_main
return_value = self._main(**kwargs)
File "C:\Users\sleibrock\AppData\Local\Programs\Python\Python35\lib\site-packages\s3transfer\upload.py", line 679, in _main
client.put_object(Bucket=bucket, Key=key, Body=body, **extra_args)
File "C:\Users\sleibrock\AppData\Local\Programs\Python\Python35\lib\site-packages\botocore\client.py", line 253, in _api_call
return self._make_api_call(operation_name, kwargs)
File "C:\Users\sleibrock\AppData\Local\Programs\Python\Python35\lib\site-packages\botocore\client.py", line 543, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (SignatureDoesNotMatch) when calling the PutObject operation: The request signature we calculated does not match the signature you provided. Check your key and signing method.
Has anyone run into this problem with Heroku/S3/Django before and have a solution? Are there any settings that can be changed to fix this issue? I can post more info as needed, thank you.
The text was updated successfully, but these errors were encountered:
It's stupidity on my part. In my Django project I had a blank file to keep a folder in my Git tracker to run the project. You can't generate a signature for a blank file that has no bytes written to it, so I wrote one character to the file, saved it and it worked without an issue.
Hi, I'm currently using
django-storages
in conjunction with Amazon S3 to upload images from a Django application running on Heroku. I added the setting vars as per the docpage here, which leads to an error saying to useAWS4-HMAC-SHA256
when trying to dopython manage.py collectstatic
.Using sdeleeuw's instructions here changes the request to use v4 authentication, but now it's giving me a
SignatureDoesNotMatch
error. However, I can perfectly upload files withboto3
with my current credentials and with v4 authentication in a script like this:Here is my output log which doesn't really tell much of a story
Has anyone run into this problem with Heroku/S3/Django before and have a solution? Are there any settings that can be changed to fix this issue? I can post more info as needed, thank you.
The text was updated successfully, but these errors were encountered: