S
S
stahon2014-07-14 23:56:23
Django
stahon, 2014-07-14 23:56:23

Why can't disable auto-escaping in django?

I have the following html template code:

<div id="basic-modal-content">
  <div class='header'><span>Название проекта</span></div>
  <p class="message">{% autoescape off %}{{ message }}{% endautoescape %}</p>
</div>

The message variable has its own html tags that are escaped despite {% autoescape off %}. What could be the reason?
The safe filter tried - too does not help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
gimntut, 2014-07-15
@gimntut

It is possible that message is escaped before it even enters the template.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question