Is using the "escape" tag really mandatory as a good security template in Django?

In the security chapter of Django Book , he says that I should always use a template tag {% escape %}to protect my site from cross-site scripting.

Do I really need to put an escape tag on every line of the template? Is there any way to indicate this at the application level?

+3
source share
2 answers

This version of the Django book was written long before the release of 1.0 and is significantly outdated. All template content has been auto-exploited for quite some time.

+4
source

django . , autoescape. , , , 1.1.

{% autoescape off %}
  safe stuff
{% endautoscape %}
+2

Source: https://habr.com/ru/post/1790898/


All Articles