title: How do I disable Django's autoescape from a view?
body: <p>Django says there's 3 ways to turn off autoescape:</p>
  
  <ol>
  <li>Use <code>|safe</code> after the variable</li>
  <li>Use <code>{% autoescape on %}</code> and <code>{% endautoescape %}</code> within blocks</li>
  <li>Use a Context like <code>context = Context({'message': message}, autoescape=False)</code></li>
  </ol>
  
  <p>(1) and (2) work fine. But I have the situation where I have templates to generate plain-text push notifications, and I have LOADS of templates to build and maintain.  I could go through and put the <code>{% autoescape on %}</code> and <code>{% endautoescape %}</code> tags in all of them, but (3) should allow me to do it in one line in the view.</p>
  
  <p>The template:</p>
  
  <pre><code>{% block ios_message %}{{message}}{% endblock %}
  </code></pre>
  
  <p>The view:</p>
  
  <pre><code>message = u"'&amp;&lt;&gt;"
  context = Context({'message': message}, autoescape=False)
  render_block_to_string(template_name, 'ios_message', context)
  </code></pre>
  
  <p>The output:</p>
  
  <pre><code>u'&amp;#39;&amp;amp;&amp;lt;&amp;gt;
  </code></pre>
  
  <p>The code for block_render.py is from here: <a href="https://github.com/uniphil/Django-Block-Render/blob/master/block_render.py" rel="nofollow">https://github.com/uniphil/Django-Block-Render/blob/master/block_render.py</a>. I'm using it as is from there.</p>
  
  <p>Anyone know what gives?</p>