Django compressor tags ignored on production machine

I'm using django compressor (1.3) but it seems to be ignored on my production machine.

I've tested on my local (with manage.py run server ), and both css and js are being amalgamated (although not minified). However on my development machine, the {% compress %} tags seem to be completely ignored.

My base template looks something like -

{% load compress %}

<!DOCTYPE html>
<html lang="en-GB">
<head>
{% block css %}
    {% compress css %}
        <link rel='stylesheet' type='text/css' href='{{ STATIC_URL }}css/base.css'  media="all"/>
        <link rel='stylesheet' type='text/css' href='{{ STATIC_URL }}css/nav.css'  media="all"/>
        <link rel='stylesheet' type='text/css' href='{{ STATIC_URL }}css/catalog.css'  media="all"/>
        <link rel='stylesheet' type='text/css' href='{{ STATIC_URL }}css/cart.css'  media="all"/>
        <link rel='stylesheet' type='text/css' href='{{ STATIC_URL }}css/content.css'  media="all"/>
    {% endcompress %}
{% endblock css %}

'compressor' is listed in my installed apps setting and I've set COMPRESS_ENABLED to True (in order to test on my local machine).

I expect I'm missing something obvious but I've been searching for a while now..

UPDATE

django-compressor is installed on my production machine (using pip install -r requirements.txt in a virtualenv).

DEBUG is set to False and I'm using the following static files finders -

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
    'django.contrib.staticfiles.finders.FileSystemFinder',
    'compressor.finders.CompressorFinder',
)

FURTHER UPDATE

I can compress everything inline (within the html) if I add the inline parameter to the {% compress %} tag. However nothing happens when I use the file parameter (I'd rather use an external file that can be cached - so sticking with the inline option isn't ideal).

链接地址: http://www.djcxy.com/p/68516.html

上一篇: Django Compressor不会缩小文件

下一篇: Django压缩机标签在生产机器上被忽略