I want to serve my compressed CSS/JS from CloudFront (they live on S3), but am unable to work out how to do it via the compressor settings in settings.py, I have the followi
Additionally, for streaming distributions it's useful to override the url
function to allow rtmp://
urls, as in:
import urlparse
class VideoStorageForCloudFrontStreaming(S3BotoStorage):
"""
Use when needing rtmp:// urls for a CloudFront Streaming distribution. Will return
a proper CloudFront URL.
Subclasses must be sure to set custom_domain.
"""
def url(self, name):
name = urlparse.quote(self._normalize_name(self._clean_name(name)))
return "rtmp://%s/cfx/st/%s" % (self.custom_domain, name)
# handy for JW Player:
@Property
def streamer(self):
return "rtmp://%s/cfx/st" % (self.custom_domain)