[Django]-Turn off autoescaping in template.render

3👍

An autoescape option has been added to the Django template backend in ticket 25469. The change will be included in the upcoming Django 1.10.

Note that you may have to enable two instances of the Django template backend in your TEMPLATES setting, one that enables auto escaping, and one that does not (see this comment from the ticket. You can then choose the correct template backend depending on whether or not you want autoescape to be enabled.

Until Django 1.10 is release, note that passing a Context to render() is only deprecated in Django 1.8. It still works in Django 1.8 and 1.9.

Leave a comment