Requires a valid Date or x-amz-date header?
Posted
by Jordan Messina
on Stack Overflow
See other posts from Stack Overflow
or by Jordan Messina
Published on 2010-04-06T04:08:18Z
Indexed on
2010/04/06
4:13 UTC
Read the original article
Hit count: 366
I'm getting the following error when attempting to upload a file to S3:
S3StorageError: <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>AWS authentication requires a valid Date or x-amz-date header</Message><RequestId>7910FF83F3FE17E2</RequestId><HostId>EjycXTgSwUkx19YNkpAoY2UDDur/0d5SMvGJUicpN6qCZFa2OuqcpibIR3NJ2WKB</HostId></Error>
I'm using Django with Django-Storages and Imagekit
My S3 settings in my settings.py looks as follows:
locale.setlocale(locale.LC_TIME, 'en_US')
DEFAULT_FILE_STORAGE = 'backends.s3.S3Storage'
AWS_ACCESS_KEY_ID = '************************'
AWS_SECRET_ACCESS_KEY = '*****************************'
AWS_STORAGE_BUCKET_NAME = 'static.blabla.com'
AWS_HEADERS = {
'x-amz-date': datetime.datetime.utcnow().strftime('%a, %d %b %Y %H:%M:%S GMT'),
'Expires': 'Thu, 15 Apr 2200 20:00:00 GMT',
}
from S3 import CallingFormat
AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN
Thanks for any help you can give!
© Stack Overflow or respective owner