Skip to content
Advertisement

Django template run {{ }} without execute

In django template I write <p>"{{sometext}}"</>p. But when it is executed it convert like <p>""</p>. How to avoid this.

Advertisement

Answer

You can work with the {% verbatim %}…{% endverbatim %} template tags [Django-doc] to turn of interpolation locally:

{% verbatim %}<p>"{{sometext}}"</p>{% endverbatim %}
Advertisement