[Answered ]-How to have Django *not* parse "{{variable}}" when using Jsrender?

1👍

You can choose alternative delimiters in JsRender, so as to avoid the conflict with Django delimiters.

https://www.jsviews.com/#settings/delimiters

For example:

$.views.settings.delimiters("<%", "%>");

will change the tag syntax to <%...%>.

0👍

You can turn on the {% verbatim %} … {% endverbatim %} template tag [Django-doc]:

{% verbatim %}
    <script id="headerTemplate" type="text/x-jsrender">
        <h1>{{:label}}</h1>
    </script>
{% endverbatim %}

This will thus render the double curly brackets, not interpret these.

Leave a comment