Begin enabling CloudFront
authorCharles Connell <charles@connells.org>
Fri, 25 Apr 2014 20:06:39 +0000 (16:06 -0400)
committerCharles Connell <charles@connells.org>
Fri, 25 Apr 2014 20:06:39 +0000 (16:06 -0400)
karmaworld/settings/prod.py
karmaworld/settings/vmdev.py

index bd63ab762a55ed17734c5f6bf28264280522df4f..c2f16623cc169b555aae49e1ee330c8597ebc275 100644 (file)
@@ -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 += [
index 8524fa22ee2c0122ae7529f2a37714b6002c603c..d83a3810cdc5322cd61c152c3d80227384a4f1d8 100644 (file)
@@ -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