<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Oom &#187; context</title>
	<atom:link href="http://web.pyncus.com/tag/context/feed/" rel="self" type="application/rss+xml" />
	<link>http://web.pyncus.com</link>
	<description>Build and Share Web Technology</description>
	<lastBuildDate>Mon, 25 Jan 2010 18:19:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>What is render_to_response?</title>
		<link>http://web.pyncus.com/2009/07/25/what-is-render_to_response/</link>
		<comments>http://web.pyncus.com/2009/07/25/what-is-render_to_response/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 12:46:53 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[render_to_response]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://weboom.wordpress.com/?p=238</guid>
		<description><![CDATA[It performs three functions. 1. load the template 2. render the output 3. create the HttpResponse e.g., In views.py &#8212;&#8212;&#8212;&#8212;- from django.shortcuts import render_to_response def home_page(request): return render_to_response(&#8216;home.html&#8217;, {&#8216;card_list&#8217;:Card.objects.all(), &#8216;user&#8217;: request.user}) &#8212;&#8212;&#8211; home.html is the name of the template file {&#8216;card_list&#8217;:Card.objects.all(), &#8216;user&#8217;: request.user} is the Context to pass to the home.html]]></description>
			<content:encoded><![CDATA[<p>It performs three functions.</p>
<p>1. load the template</p>
<p>2. render the output</p>
<p>3. create the HttpResponse</p>
<p>e.g., In views.py</p>
<p>&#8212;&#8212;&#8212;&#8212;-</p>
<p>from django.shortcuts import render_to_response</p>
<p>def home_page(request):</p>
<p>return render_to_response(&#8216;home.html&#8217;,<br />
{&#8216;card_list&#8217;:Card.objects.all(), &#8216;user&#8217;: request.user})</p>
<p>&#8212;&#8212;&#8211;</p>
<p>home.html</p>
<p>is the name of the template file</p>
<p>{&#8216;card_list&#8217;:Card.objects.all(), &#8216;user&#8217;: request.user}</p>
<p>is the Context to pass to the home.html</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/07/25/what-is-render_to_response/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Context ?</title>
		<link>http://web.pyncus.com/2009/07/25/what-is-context/</link>
		<comments>http://web.pyncus.com/2009/07/25/what-is-context/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 12:40:44 +0000</pubDate>
		<dc:creator>weboom</dc:creator>
				<category><![CDATA[django]]></category>
		<category><![CDATA[context]]></category>

		<guid isPermaLink="false">http://weboom.wordpress.com/?p=236</guid>
		<description><![CDATA[Context is a class used to represent the variables for a template. Pass it to a Python dictionary containing the names of the variables and their values. &#8212;&#8212;&#8212;- e.g., the below Context {&#8216;card_list&#8217;:Card.objects.all(), &#8216;user&#8217;=request.user} &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; this will go to template and used &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; {% if user.is_authenticated %} Welcome {{ user }} &#60;br&#62;&#60;/br&#62; &#60;a href=&#8221;{% url <a href='http://web.pyncus.com/2009/07/25/what-is-context/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Context</p>
<p>is a class used to represent the variables for a template.</p>
<p>Pass it to a Python dictionary containing the names of the variables and their values.</p>
<p>&#8212;&#8212;&#8212;-</p>
<p>e.g., the below Context</p>
<p>{&#8216;card_list&#8217;:Card.objects.all(), &#8216;user&#8217;=request.user}</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>this will go to template and used</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>{% if <strong>user</strong>.is_authenticated %}<br />
Welcome {{ <strong>user</strong> }} &lt;br&gt;&lt;/br&gt;<br />
&lt;a href=&#8221;{% url logout %}&#8221;&gt;Logout&lt;/a&gt;<br />
{% else %}<br />
&lt;a href=&#8221;{% url login %}&#8221;&gt;Login&lt;/a&gt; |<br />
&lt;a href=&#8221;{% url signup %}&#8221;&gt; Signup &lt;/a&gt;<br />
{% endif %}</p>
<p>{%for card in <strong>card_list</strong> %}<br />
&lt;h2&gt; &lt;a href=&#8221;{{card.get_absolute_url}}&#8221;&gt; {{card.name}}&lt;/a&gt;&lt;/h2&gt;<br />
&lt;p&gt;{{card.description}}&lt;/p&gt;</p>
<p>{%endfor%}</p>
]]></content:encoded>
			<wfw:commentRss>http://web.pyncus.com/2009/07/25/what-is-context/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

