python - Error when trying to compress static files when using django-storages and django-compressor together -


i have setup aws s3 bucket in order transfer static files in remote cdn using application django-storages, worked fine until tried compress static files before uploading s3 using django_compressor.

i have setup variables according django_compressor documentation django-storages (https://django_compressor.readthedocs.org/en/latest/remote-storages/index.html)

i uploaded files in s3 using 'manage.py collectstatic' then:

when 'manage.py compress' error:

commanderror: error occured during rendering ../templates/base.html: 'https://my_bucket.s3.amazonaws.com/css/bootstrap.2.3.1.css' isn't accessible via compress_url ('https://my_bucket.s3-external-3.amazonaws.com/') , can't compressed 

what's wrong setup?

here settings.py configuration django-storages , django_compressor:

compress_url = 'https://mybucket_name.s3-external-3.amazonaws.com/' static_url = compress_url default_file_storage = 'my_project.boto_custom.cacheds3botostorage'  aws_access_key_id = 'xxx' aws_secret_access_key = 'xxx' aws_storage_bucket_name = 'mybucket_name'  compress_root = static_root  compress_storage = 'my_project.boto_custom.cacheds3botostorage' staticfiles_storage = 'my_project.boto_custom.cacheds3botostorage'  compress_offline = true 

thanks help

i fixed adding 1 variable , worked:

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

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -