5

I just upgrade Django 1.4.2 to 1.5 and I started to get an error on django_compressor.

You have offline compression enabled but key "eb225276268ea55d3b90c71df63109d9" is missing from offline manifest. You may need to run "python manage.py compress".

Also, I updated django_compressor to the last version (actual 1.2), and still getting the same error.

When I try python manage.py compress I am noticed that:

c:\python27\lib\site-packages\django\utils\hashcompat.py:9: DeprecationWarning: django.utils.hashcompat is deprecated; use hashlib instead DeprecationWarning)

Is this notice related with the offline compression error?

[UPDATED] I am finding another interesting thing...

In the template that I am having problem I removed all css that should be compressed:

 {% extends "base.html" %}
    {%  block head %}
        {% load compress %}
        {% compress css %}

        {% endcompress %}
    {% endblock %}
...

I ran python manage:

python manage.py compress 
python manage.py collectstatic   --noinput

without errors.

But... The problem still happen.

You have offline compression enabled but key "e764a8b7e7e314ed8c98aa5d25fc76b4" is missing from offline manifest. You may need to run "python manage.py compress".
1   {% extends "base.html" %}
2   {% block head %}
3   {% load compress %}
4   {% compress css %}
5   
6   {% endcompress %}
7   {% endblock %}
8   

Another important information: the .html file was listed when I ran python manage.py compress

4

3 回答 3

3

Well, I had to remove all {% load compress %} block from the internal pages, and included every js and css in the base.html. Now it worked. But I still finding very strange that this issue just happened after django update.

于 2013-03-02T18:28:10.967 回答
0

I had the same issue, i tried every possible solution that i found in internet, but in vain every time i run python manage.py compress i used to get the same error.

At last i thought instead of finding solution's why don't i debug by reading compress.py (the path of the file was there in the error console), by doing this i figured out that there were compress tags inside compress tag.

{% compress js%} {% compress js%}

{% endcompress %}

{% endcompress %}

So the key was always not their in the manifest.json file.

于 2015-10-03T19:31:20.047 回答
-1

No.

The error is telling you that, although you have offline compression enabled, the process has never been run, or the cache is empty.

Basically, if you tell compressor NOT to try to compress files on every HTTP request (offline compression), it will look to Django's cache system to find the path to the compressed version of your assets.

If offline compression is enabled, and it can't find the path to the files the cache says should be there, it freaks out.

于 2013-02-27T07:18:27.510 回答