1

I have configured django to use s3 to hold media files. I can from the application upload files and they are stored on the s3, however if i try to view these media files i get this error.

<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>
The request signature we calculated does not match the signature you provided. Check your key and signing method.
</Message>

I know GET requests are enabled as I can use Postman to get the images using the same credentials. So I'm not entirely sure whats wrong.

STATIC_ROOT = os.path.join(BASE_DIR, '/staticfiles/')
STATIC_URL = '/static/'

MEDIA_ROOT = os.path.join(BASE_DIR, '/image_library/')
MEDIA_URL = '/media/'

AWS_ACCESS_KEY_ID = 'PLACEHOLDER'

AWS_SECRET_ACCESS_KEY = 'PLACEHOLDER'

AWS_STORAGE_BUCKET_NAME = 'childcaredevapp'

AWS_DEFAULT_ACL = None

AWS_S3_FILE_OVERWRITE = False

AWS_S3_SIGNATURE_VERSION = "s3v4"

AWS_S3_REGION_NAME = 'eu-central-1'

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'

2 Answers 2

2

So... Long story short, i achieved it to create correct signature by removing AWS_S3_SIGNATURE_VERSION = "s3v4" line. Looks like they dont match for some reason.

Sign up to request clarification or add additional context in comments.

Comments

0

I faced this error, I solve it by adding the AWS_S3_ADDRESSING_STYLE variable:

AWS_S3_ADDRESSING_STYLE = "virtual"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.