django-compressor

Does django-compressor work with template inheritance?

爷,独闯天下 提交于 2019-11-30 04:09:00
问题 I'm using django-compressor to compress my site's static CSS and Javascript files. Since I serve my site's static assets via Amazon S3, I'm also using django-storages to upload my files to S3. Here's my issue: I'm trying to make a clean base.html template that all my site's other templates can inherit and extend. Here's what it looks like currently: {% load compress %} <html> <head> <!-- test --> {% compress css %} <link rel="stylesheet" type="text/css" media="screen" href="{{ STATIC_URL }

Is it possible to use django_compressor/S3/gzip?

ぐ巨炮叔叔 提交于 2019-11-29 14:05:45
问题 How is it possible to use django_compressor to send gziped files to Amazon S3? I tried in several ways but it didn't work. Here is my last settings.py configuration: COMPRESS_ENABLED = True COMPRESS_OFFLINE = True COMPRESS_ROOT = STATIC_ROOT COMPRESS_URL = "http://xxx.cloudfront.net/" STATIC_URL = COMPRESS_URL COMPRESS_OUTPUT_DIR = 'CACHE' #COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage' COMPRESS_STORAGE = 'core.storage.CachedS3BotoStorage' STATICFILES_STORAGE = 'compressor

Django-compressor: how to write to S3, read from CloudFront?

谁说胖子不能爱 提交于 2019-11-28 16:25:54
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 following: COMPRESS_OFFLINE = True COMPRESS_URL = 'http://static.example.com/' #same as STATIC_URL, so unnecessary, just here for simplicity COMPRESS_STORAGE = 'my_example_dir.storage.CachedS3BotoStorage' #subclass suggested in [docs][1] COMPRESS_OUTPUT_DIR = 'compressed_static' COMPRESS_ROOT = '/home/dotcloud/current/static/' #location of static files on server Despite the COMPRESS_URL, my files are being read from my s3 bucket:

Django-compressor: how to write to S3, read from CloudFront?

巧了我就是萌 提交于 2019-11-27 09:42:06
问题 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 following: COMPRESS_OFFLINE = True COMPRESS_URL = 'http://static.example.com/' #same as STATIC_URL, so unnecessary, just here for simplicity COMPRESS_STORAGE = 'my_example_dir.storage.CachedS3BotoStorage' #subclass suggested in [docs][1] COMPRESS_OUTPUT_DIR = 'compressed_static' COMPRESS_ROOT = '/home/dotcloud/current/static/'