django - Which of autoescape tag and safe filter is better to use? -


i looking way unescape html in variables written in django template , found answer here. so, there 2 ways of doing it:

  • set autoescape off:

    {% autoescape off %}{{ myhtmlstring }}{% endautoescape %} 
  • using safe filter:

    {{ myhtmlstring | safe }} 

my question 1 more adequate use (and in context). feeling safe filter django specific, on contrary autoescape seems used in jinja2. but, own way of thinking ?


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -