Reference

You can use the full power of the Django template language. Additionally the following libraries are on your disposal:

Django CMS

In order for Django CMS to work, you need to include the css and js sekizai blocks and add {% cms_toolbar %} after the closing </body> tag.

Django Sekizai

With sekizai you can include additional assets such as CSS or JavaScript. Simply add {% load sekizai_tags %} on top of your file and use {% addtoblock "js" %} or {% addtoblock "css" %}.

When including a single file, do not add any white spaces or breaks inside. Sekizai validates code for dublicates and comfortably only includes one instance. So if you already include jQuery, Sekizai will only render it once.

The output is rendered within {% render_block "css" %} and {% render_block "js" %} in templates/base_root.html.

Example

{% load sekizai_tags %}
{% addtoblock "css" %}<script src="{% static "css/theme.css" %}"></script>{% endaddtoblock %}
{% addtoblock "js" %}
<script>
jQuery(document).ready(function ($) {
    alert('hello world');
});
</script>
{% endaddtoblock %}

Django Compress

Django compressor should also be enabled within your setup. This allows you to compress files automatically on a live system.

Example

{% load compress %}

{% compress js %}
<script src="{% static "js/base.js" %}"></script>
<script>obj.value = 'value';</script>
{% endcompress %}

Aldryn Snake

Aldryn snakes behaves similar to django-sekizai but is mostly used within the backend. The output is rendered within {{ ALDRYN_SNAKE.render_head }} and {{ ALDRYN_SNAKE.render_tail }}.

Aldryn snakes allows the additional insertion of html fragments or any other textual data.