私は、Django 1.6 で静的ファイルの圧縮と展開を正常に使用django-compressor
し、管理してきました。django-storages
現在、AWS CloudFront を使用して静的ファイルを提供しようとしています。
ここの指示に従いましたdefault_storage.exists 非常に遅く、頻繁にタイムアウトし、settings.py
ファイルは次のようになります。
COMPRESS_ENABLED = True
STATIC_ROOT = os.path.join(
os.path.dirname(
os.path.dirname(
os.path.abspath(__file__))), 'static')
COMPRESS_ROOT = STATIC_ROOT
COMPRESS_OFFLINE = True
COMPRESS_URL = "https://compressor-test.s3.amazonaws.com/"
STATIC_URL = COMPRESS_URL
COMPRESS_STORAGE = 'mysite.storage.CachedS3BotoStorage'
STATICFILES_STORAGE = COMPRESS_STORAGE
AWS_STORAGE_BUCKET_NAME = 'compressor-test'
AWS_S3_CUSTOM_DOMAIN = '1234567.cloudfront.net'
しかし、次のエラーが発生します。
Exception Type: UncompressableFileError
Exception Value:
'https://1234567.cloudfront.net/bootstrap/css/bootstrap.min.css' isn't accessible via COMPRESS_URL ('https://compressor-test.s3.amazonaws.com/') and can't be compressed
COMPRESS_URL を CloudFront に向ける必要がありますか?