Completely disable auto-escape

1 view
Skip to first unread message

Udi

unread,
Dec 14, 2007, 5:18:07 AM12/14/07
to Django users
Is there any way to turn this completely off? It would be nice to be
able to get the latest django src before I refactor all my code to
handle this new stuff.

{% autoescape off %} works fine if all of your templates inherit from
a base, but if you use lots of little tags and elements this may not
be the case.

Is there something that I can put in my settings.py file to turn it
off entirely?

Thanks!
Udi

Malcolm Tredinnick

unread,
Dec 17, 2007, 7:06:28 AM12/17/07
to django...@googlegroups.com

No, and that's by design. Template authors and application writers have
no control over what is in the settings file and those two groups need
to be able to write applications that will work anywhere.

If you really, really need to make this change temporarily, edit your
Django source. In django/template/context.py, change the default value
of "autoescape" in the Context.__init__() parameter list to False.
However, I suspect you'll find there are unintended side-effects. In the
admin application, for example, so be careful.

Regards,
Malcolm

--
If Barbie is so popular, why do you have to buy her friends?
http://www.pointy-stick.com/blog/

Reply all
Reply to author
Forward
0 new messages