From: Charles Connell Date: Fri, 25 Apr 2014 20:06:39 +0000 (-0400) Subject: Begin enabling CloudFront X-Git-Tag: release-20150131~120 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2f3d254703ee44baacae45e427011d75f729c559;p=oweals%2Fkarmaworld.git Begin enabling CloudFront --- diff --git a/karmaworld/settings/prod.py b/karmaworld/settings/prod.py index bd63ab7..c2f1662 100644 --- a/karmaworld/settings/prod.py +++ b/karmaworld/settings/prod.py @@ -138,7 +138,7 @@ AWS_HEADERS = { # See: https://docs.djangoproject.com/en/dev/ref/settings/#static-url # S3_URL comes from karmaworld.secret.static_s3 -STATIC_URL = S3_URL +STATIC_URL = CLOUDFRONT_URL ########## END STORAGE CONFIGURATION ########## SSL FORWARDING CONFIGURATION @@ -152,10 +152,15 @@ COMPRESS_OFFLINE = True # See: http://django_compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_STORAGE COMPRESS_STORAGE = DEFAULT_FILE_STORAGE +# Make sure that django-compressor serves from CloudFront +AWS_S3_CUSTOM_DOMAIN = CLOUDFRONT_DOMAIN + # See: http://django_compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_CSS_FILTERS COMPRESS_CSS_FILTERS += [ - 'compressor.filters.css_default.CssAbsoluteFilter', + 'compressor.filters.datauri.CssDataUriFilter', + 'compressor.filters.cssmin.CSSMinFilter', ] +COMPRESS_DATA_URI_MAX_SIZE = 5120 # See: http://django_compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_JS_FILTERS COMPRESS_JS_FILTERS += [ diff --git a/karmaworld/settings/vmdev.py b/karmaworld/settings/vmdev.py index 8524fa2..d83a381 100644 --- a/karmaworld/settings/vmdev.py +++ b/karmaworld/settings/vmdev.py @@ -156,10 +156,15 @@ COMPRESS_OFFLINE = True # See: http://django_compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_STORAGE COMPRESS_STORAGE = DEFAULT_FILE_STORAGE +# Make sure that django-compressor serves from CloudFront +AWS_S3_CUSTOM_DOMAIN = CLOUDFRONT_DOMAIN + # See: http://django_compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_CSS_FILTERS COMPRESS_CSS_FILTERS += [ - 'compressor.filters.css_default.CssAbsoluteFilter', + 'compressor.filters.datauri.CssDataUriFilter', + 'compressor.filters.cssmin.CSSMinFilter', ] +COMPRESS_DATA_URI_MAX_SIZE = 5120 # See: http://django_compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_JS_FILTERS COMPRESS_JS_FILTERS += [ @@ -229,3 +234,6 @@ MIDDLEWARE_CLASSES += ( ) ########## END PROFILING CONFIGURATION +########## STATIC CONFIGURATION +STATIC_URL = CLOUDFRONT_URL +########## END STATIC CONFIGURATION