2
我正在使用Mezzanine,django-compressor和amazon-s3。我使用django-compressor来压缩css文件。我已经将网站部署到Heroku并成功地存储了静态资源。但是,一段时间后,所有的CSS都会丢失。以下是从亚马逊S3的通知:无法访问静态资源
<Error>
<Code>AccessDenied</Code>
<Message>Request has expired</Message>
<RequestId>FCE5D863FC2EBB9D</RequestId>
<Expires>2012-11-16T17:30:01Z</Expires>
<HostId>
aXa9JBZWx5UiwJmIfpTXsUZgeNGQDONx0G/IezufvWv1FwAUlnK8bzo2u+Qdsenj
</HostId>
<ServerTime>2012-11-16T18:10:17Z</ServerTime>
</Error>
而且这是在设定的配置:
from datetime import date, timedelta
ten_years = date.today() + timedelta(days=365*10)
# Expires 10 years in the future at 23h GMT
AWS_HEADERS = {
'Expires': ten_years.strftime('%a, %d %b %Y 23:00:00 GMT'),
'Cache-Control': 'max-age=386900',
}
请帮我解决这个问题。我找不到根本原因。 非常感谢。