From ccbcd6cd6a20abb9807abfd56f017ee6a0632a60 Mon Sep 17 00:00:00 2001 From: Kaveh Date: Mon, 20 Apr 2015 13:05:01 -0500 Subject: [PATCH 1/2] Fixed a bug with escaped spaces in Cache-Control. see: https://github.com/boto/boto/issues/2536 --- .../{{cookiecutter.repo_name}}/config/production.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py index 3e03e7f2..d5c6c649 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py @@ -70,8 +70,9 @@ INSTALLED_APPS = ('collectfast', ) + INSTALLED_APPS # AWS cache settings, don't change unless you know what you're doing: AWS_EXPIRY = 60 * 60 * 24 * 7 AWS_HEADERS = { - 'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % ( - AWS_EXPIRY, AWS_EXPIRY) + 'Cache-Control': str.encode( + 'max-age=%d, s-maxage=%d, must-revalidate' % ( + AWS_EXPIREY, AWS_EXPIREY)) } # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url From a2947ecc736893b2d55e4e28d4dfabbe65b440d3 Mon Sep 17 00:00:00 2001 From: Kaveh Date: Fri, 24 Apr 2015 13:32:37 -0500 Subject: [PATCH 2/2] Added a note as a reminder to revert the last commit after this issue is fixed: https://github.com/jschneier/django-storages/issues/47 --- .../{{cookiecutter.repo_name}}/config/production.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py index d5c6c649..e5a9902a 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py @@ -69,6 +69,10 @@ INSTALLED_APPS = ('collectfast', ) + INSTALLED_APPS # AWS cache settings, don't change unless you know what you're doing: AWS_EXPIRY = 60 * 60 * 24 * 7 + +# TODO See: https://github.com/jschneier/django-storages/issues/47 +# Revert the following and use str after the above-mentioned bug is fixed in +# either django-storage-redux or boto AWS_HEADERS = { 'Cache-Control': str.encode( 'max-age=%d, s-maxage=%d, must-revalidate' % (