I have a website with various js files, and i'm using django-compressor like so:

{% compress js %}
{% endcompress %}

{% compress js %}
{% endcompress %}

For some reason its only creating the FIRST js file. I have my app hosted on an EC2. I can see the first file there. The second file appears when I do a view source on the page, however, the file itself doens't exist (I get a 404 when I click on the link to the second js file). Is there anything I'm doing wrong? I have my settings as per below:

COMPRESS_ENABLED = not DEBUG
COMPRESS_PARSER = 'compressor.parser.BeautifulSoupParser'
COMPRESS_CSS_FILTERS = ['compressor.filters.cssmin.CSSMinFilter']
COMPRESS_JS_FILTERS = ['compressor.filters.jsmin.JSMinFilter']

It's working perfectly for css files...but failing on any other js file after the first compress flag...

有帮助吗?

解决方案

I honestly have no idea what happened. this used to work perfectly, but randomly stopped out of no where! I did the following and it worked:

python manage.py compress --force

This basically forces it to compress all files; normally django-compressor ignores files that have not changed and have been compressed already.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top