<?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: How to get at request in a template</title>
	<atom:link href="http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/</link>
	<description></description>
	<lastBuildDate>Sun, 15 Aug 2010 05:18:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Marc Remolt</title>
		<link>http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/comment-page-1/#comment-32315</link>
		<dc:creator>Marc Remolt</dc:creator>
		<pubDate>Fri, 19 Dec 2008 12:45:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/#comment-32315</guid>
		<description>All generic views automatically use RequestContext, so with direct_to_template you can use {{ request }}. 

For render_to_response, you have to manually pass it to activate the context processors:
...
return render_to_response(&#039;template.html&#039;, { my_context_as_dict }, context_instance = RequestContext(request))</description>
		<content:encoded><![CDATA[<p>All generic views automatically use RequestContext, so with direct_to_template you can use {{ request }}. </p>
<p>For render_to_response, you have to manually pass it to activate the context processors:<br />
&#8230;<br />
return render_to_response(&#8216;template.html&#8217;, { my_context_as_dict }, context_instance = RequestContext(request))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rachel</title>
		<link>http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/comment-page-1/#comment-32278</link>
		<dc:creator>Rachel</dc:creator>
		<pubDate>Thu, 18 Dec 2008 18:48:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/#comment-32278</guid>
		<description>This is referring to the case where you&#039;re just calling a template directly from the urls.py with &#039;direct_to_template&#039; so no opportunity to do anything in the view.

I hadn&#039;t made that clear, thanks, I&#039;ve added a wee note on that.</description>
		<content:encoded><![CDATA[<p>This is referring to the case where you&#8217;re just calling a template directly from the urls.py with &#8216;direct_to_template&#8217; so no opportunity to do anything in the view.</p>
<p>I hadn&#8217;t made that clear, thanks, I&#8217;ve added a wee note on that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Enrico</title>
		<link>http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/comment-page-1/#comment-32277</link>
		<dc:creator>Enrico</dc:creator>
		<pubDate>Thu, 18 Dec 2008 18:29:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/#comment-32277</guid>
		<description>I think you forgot, you need to use RequestContext in your view in order to get the request available in the template.

That&#039;s because the request isn&#039;t globally available.

Check this page:
http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/</description>
		<content:encoded><![CDATA[<p>I think you forgot, you need to use RequestContext in your view in order to get the request available in the template.</p>
<p>That&#8217;s because the request isn&#8217;t globally available.</p>
<p>Check this page:<br />
<a href="http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/" rel="nofollow">http://www.b-list.org/weblog/2006/jun/14/django-tips-template-context-processors/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter</title>
		<link>http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/comment-page-1/#comment-32275</link>
		<dc:creator>Peter</dc:creator>
		<pubDate>Thu, 18 Dec 2008 17:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/#comment-32275</guid>
		<description>If you really need to access request across multiple views, it&#039;s smarter to use the context processor.</description>
		<content:encoded><![CDATA[<p>If you really need to access request across multiple views, it&#8217;s smarter to use the context processor.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/comment-page-1/#comment-32274</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Thu, 18 Dec 2008 17:08:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.willmer.com/kb/2008/12/how-to-get-at-request-in-a-template/#comment-32274</guid>
		<description>Django noob here: is this any better or worse then simply passing along request from the view?</description>
		<content:encoded><![CDATA[<p>Django noob here: is this any better or worse then simply passing along request from the view?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
