Skip to content
Justice Tech School

Auto Escaping

Django escapes HTML by default.

Example
{{ comment }}
{{ trusted_html|safe }}
{% autoescape off %}{{ x }}{% endautoescape %}

Exercise

Mark safe.

{{ x| }}

Quiz Test

Is output escaped by default?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.