Django compressor offline compress with pyjade

914 views Asked by At

I'm using pyjade in my django project. I also started using django compressor and for performance issues I need to use the offline compression.

I set the COMPRESS_OFFLINE to True in my settings.file

I ran the command: "manage.py compress --extension=jade" to generate the precompiled files and the manifest.json file.

The problem is that when I try to render the page, django raises an exception:

OfflineGenerationError at /new/

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

I checked my manifest, here it is:

{ "608f1d299c1a9d4141630b7ebb668456": "" }

Here is my jade template

doctype 5

{% load compress %}
{% load staticfiles %}

html(lang="es")
  head
    meta(charset="utf-8")
    title my page {% block title %} {%endblock%}

    {% compress css %}
    link(rel="stylesheet", href="{% static 'css/style.css' %}")
    {% endcompress %}

Any thoughts?

1

There are 1 answers

2
Pratik Mandrekar On

Have you set django.conf.settings.COMPRESS_OFFLINE to True before running python manage.py compress? The key the template is expecting seems to be different from the key in the manifest. There is a chance things might just be out of sync.