Reputation: 573
I've got Wagtail set up with Django-Compressor (COMPRESS OFFLINE = True
) which all works except for one template.
This template uses the Disqus plugin which requires:
In my template I have included the following:
{% compress js inline %}
// My JS Code
this.page.url = "{{ page.full_url }}";
this.page.identifier = {{ page.id }};
{% endcompress %
So when accessing the page I get the error You have offline compression enabled but key "ARANDOMKEYGOESHERE" is missing from offline manifest.
As per the Django-Compressor docs:
If you use any variables inside the
{% compress %}
blocks, make sure to list all values you require inCOMPRESS_OFFLINE_CONTEXT
How would I go about adding the Page
instance to the context in my settings? I thought of something like (pseudo-code):
COMPRESS_OFFLINE_CONTEXT = { 'page': request.get('page') }
Upvotes: 0
Views: 253