Escapes HTML characters.
Variable
blurb = '<p>You are <em>pretty</em> smart!</p>'
Template
{% autoescape off %}
<code>{{ blurb|escape }}</code> will output:
{{ blurb }}
{% endautoescape %}
Result
<code><p>You are <em>pretty</em> smart!</p></code> will output:
<p>You are <em>pretty</em> smart!</p>
The browser output would be:
<p>You are <em>pretty</em> smart!</p>
will output:
You are pretty smart!
The escape
filter is only relevant if autoescaping is off.