I would like to be able to
- Compile all js/css into single minified files, which is what
django-compressor
does. - Be able to add js/css files from included and inherited templates.
When I try:
{% compress css file %}
{% render_block "css" %}
{% endcompress %}
I get the error: Invalid block tag: 'endcompress'
But I think the main cause is from the sekizai docs:
{% render_block %}
tags must not be placed inside a template tag block (a template tag which has an end tag, such as{% block %}...{% endblock %}
or{% if %}...{% endif %}
).
Have I done something wrong or is there another way?
It seems django-compressor explicitly provides this interaction, but not by putting
render_block
insidecompress/endcompress
:In fact, the
{% compress %}
tag is simply not used here.I use
block css
just for the sake of having any block to putaddtoblock
in, otherwise it won't work (unless it's in the same template file):