Skip to content Skip to sidebar Skip to footer

Error When Trying To Compress Static Files When Using Django-storages And Django-compressor Together

I have setup an AWS S3 bucket in order to transfer my static files in a remote CDN using the application django-storages, everything worked fine until I tried to compress my stati

Solution 1:

I fixed it by adding one variable and it worked:

AWS_S3_CUSTOM_DOMAIN = 'my_bucket.s3-external-3.amazonaws.com'

Solution 2:

If you have separate S3 buckets for static and media you can also put it in your subclass of S3BotoStorage like so:

class CachedS3BotoStorage(S3BotoStorage):
  custom_domain = 'my_bucket.s3-external-3.amazonaws.com'

(or better yet set it to settings.AWS_S3_CUSTOM_STATIC_DOMAIN or something)

Post a Comment for "Error When Trying To Compress Static Files When Using Django-storages And Django-compressor Together"