<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Escaping autoescape in Django</title>
	<atom:link href="http://www.chickenwingsw.com/scratches/python/escaping-autoescape-in-django/feed" rel="self" type="application/rss+xml" />
	<link>http://www.chickenwingsw.com/scratches/programming/python/escaping-autoescape-in-django</link>
	<description>Developing ideas on developing.</description>
	<lastBuildDate>Fri, 20 May 2011 10:39:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: Benjamin Sergeant</title>
		<link>http://www.chickenwingsw.com/scratches/programming/python/escaping-autoescape-in-django/comment-page-1#comment-1402</link>
		<dc:creator>Benjamin Sergeant</dc:creator>
		<pubDate>Thu, 19 Mar 2009 01:04:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.chickenwingsoftware.com/scratches/?p=3#comment-1402</guid>
		<description>I had the same problem when trying to render highlighted code from pygments. Thanks for the tips !

(I used Peter Reeves per view trick with RequestContext).</description>
		<content:encoded><![CDATA[I had the same problem when trying to render highlighted code from pygments. Thanks for the tips !

(I used Peter Reeves per view trick with RequestContext).]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Reeves</title>
		<link>http://www.chickenwingsw.com/scratches/programming/python/escaping-autoescape-in-django/comment-page-1#comment-85</link>
		<dc:creator>Peter Reeves</dc:creator>
		<pubDate>Mon, 25 Feb 2008 01:13:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.chickenwingsoftware.com/scratches/?p=3#comment-85</guid>
		<description>For a single template you can also disable the autoescape in the contextinstance. I have this at the end of my function:
&lt;pre&gt;
context_instance=RequestContext(request)
context_instance.autoescape=False
return render_to_response(&#039;my_template.html&#039;, {&#039;mydata&#039;:mydata,}, context_instance)
&lt;/pre&gt;
This was because ampersands were being escaped in my template as &amp; - My template needed the ampersands intact as it fed a .swf file with the data.</description>
		<content:encoded><![CDATA[For a single template you can also disable the autoescape in the contextinstance. I have this at the end of my function:
<pre>
context_instance=RequestContext(request)
context_instance.autoescape=False
return render_to_response('my_template.html', {'mydata':mydata,}, context_instance)
</pre>
This was because ampersands were being escaped in my template as &amp;amp; - My template needed the ampersands intact as it fed a .swf file with the data.]]></content:encoded>
	</item>
	<item>
		<title>By: dibau naum h</title>
		<link>http://www.chickenwingsw.com/scratches/programming/python/escaping-autoescape-in-django/comment-page-1#comment-36</link>
		<dc:creator>dibau naum h</dc:creator>
		<pubDate>Fri, 15 Feb 2008 12:02:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.chickenwingsoftware.com/scratches/?p=3#comment-36</guid>
		<description>Thanks for posting! Works like charm.</description>
		<content:encoded><![CDATA[Thanks for posting! Works like charm.]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Sullivan</title>
		<link>http://www.chickenwingsw.com/scratches/programming/python/escaping-autoescape-in-django/comment-page-1#comment-5</link>
		<dc:creator>Eddie Sullivan</dc:creator>
		<pubDate>Tue, 29 Jan 2008 01:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.chickenwingsoftware.com/scratches/?p=3#comment-5</guid>
		<description>Thanks for the tip. That would indeed simplify things. I may even post it to this weblog when I do it.</description>
		<content:encoded><![CDATA[Thanks for the tip. That would indeed simplify things. I may even post it to this weblog when I do it.]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Willison</title>
		<link>http://www.chickenwingsw.com/scratches/programming/python/escaping-autoescape-in-django/comment-page-1#comment-4</link>
		<dc:creator>Simon Willison</dc:creator>
		<pubDate>Tue, 29 Jan 2008 01:22:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.chickenwingsoftware.com/scratches/?p=3#comment-4</guid>
		<description>If you&#039;re outputting a large amount of JSON, have you considered using a custom template tag to do so? You could write one that passes a variable through simplejson and marks it as safe at the same time (using django.utils.safestring.mark_safe() )</description>
		<content:encoded><![CDATA[If you're outputting a large amount of JSON, have you considered using a custom template tag to do so? You could write one that passes a variable through simplejson and marks it as safe at the same time (using django.utils.safestring.mark_safe() )]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie Sullivan</title>
		<link>http://www.chickenwingsw.com/scratches/programming/python/escaping-autoescape-in-django/comment-page-1#comment-3</link>
		<dc:creator>Eddie Sullivan</dc:creator>
		<pubDate>Tue, 29 Jan 2008 00:09:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.chickenwingsoftware.com/scratches/?p=3#comment-3</guid>
		<description>I&#039;ll look into posting one of the templates (they&#039;re for unpublished sites at the moment), but what&#039;s happening is a quantity of data is being passed in JSON form to some Javascript code. This of course relies on quotation marks and some other &quot;unsafe&quot; characters. Now, in future templates, and eventually in my legacy templates, I will take the autoescaping behavior into account and leave it on except when I need it off. However, for now I need existing things to work so I can proceed with development.</description>
		<content:encoded><![CDATA[I'll look into posting one of the templates (they're for unpublished sites at the moment), but what's happening is a quantity of data is being passed in JSON form to some Javascript code. This of course relies on quotation marks and some other "unsafe" characters. Now, in future templates, and eventually in my legacy templates, I will take the autoescaping behavior into account and leave it on except when I need it off. However, for now I need existing things to work so I can proceed with development.]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Willison</title>
		<link>http://www.chickenwingsw.com/scratches/programming/python/escaping-autoescape-in-django/comment-page-1#comment-2</link>
		<dc:creator>Simon Willison</dc:creator>
		<pubDate>Mon, 28 Jan 2008 23:11:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.chickenwingsoftware.com/scratches/?p=3#comment-2</guid>
		<description>Is there any chance you could post one of your templates to dpaste.com ? I haven&#039;t heard many reports of people having templates that were severely affected by auto-escaping - I&#039;d love to see what&#039;s causing your problem, as we may be able to offer a better solution.

We won&#039;t be adding a setting to settings.py though, as it will lead to the exact same problems that plagued PHP&#039;s magic quotes - people won&#039;t be able to write re-usable Django code because they won&#039;t be able to rely on auto-escaping being turned on or off.</description>
		<content:encoded><![CDATA[Is there any chance you could post one of your templates to dpaste.com ? I haven't heard many reports of people having templates that were severely affected by auto-escaping - I'd love to see what's causing your problem, as we may be able to offer a better solution.

We won't be adding a setting to settings.py though, as it will lead to the exact same problems that plagued PHP's magic quotes - people won't be able to write re-usable Django code because they won't be able to rely on auto-escaping being turned on or off.]]></content:encoded>
	</item>
</channel>
</rss>

