<?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: Using Jinja With Django</title>
	<atom:link href="http://www.davidcramer.net/code/113/using-jinja-with-django.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html</link>
	<description>A blog about Django, JavaScript, CSS, and general web development.</description>
	<lastBuildDate>Fri, 12 Mar 2010 19:46:01 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: bedava film izle</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-21045</link>
		<dc:creator>bedava film izle</dc:creator>
		<pubDate>Mon, 21 Dec 2009 16:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-21045</guid>
		<description>It converts them when the file is initialized, it doesnt do it over and over.

And if you’re at risk of your template editors hacking your site, then they shouldn’t be editing templates..</description>
		<content:encoded><![CDATA[<p>It converts them when the file is initialized, it doesnt do it over and over.</p>
<p>And if you’re at risk of your template editors hacking your site, then they shouldn’t be editing templates..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Codegrind &#187; Blog Archive &#187; Django vs Pylons</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-21032</link>
		<dc:creator>Codegrind &#187; Blog Archive &#187; Django vs Pylons</dc:creator>
		<pubDate>Mon, 30 Nov 2009 23:16:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-21032</guid>
		<description>[...] Update: I just had a look at Jinja templates and it looks like they offer some interesting tools on top of Django templates, like simple expressions (e.g. {{2+2}}) inside the template tags. The only way to do some of the stuff that Jinja does out of the box with Django is by writing your own template tag. There is a nice post on why you should use Jinja, even with Django here. [...]</description>
		<content:encoded><![CDATA[<p>[...] Update: I just had a look at Jinja templates and it looks like they offer some interesting tools on top of Django templates, like simple expressions (e.g. {{2+2}}) inside the template tags. The only way to do some of the stuff that Jinja does out of the box with Django is by writing your own template tag. There is a nice post on why you should use Jinja, even with Django here. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stephen</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-20908</link>
		<dc:creator>Stephen</dc:creator>
		<pubDate>Tue, 04 Aug 2009 01:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-20908</guid>
		<description>This article: http://lucumr.pocoo.org/2008/9/16/why-jinja-is-not-django-and-why-django-should-have-a-look-at-it makes a very persuasive technical argument why the Django template system is deficient and why the Django people should at least take a look at Jinja.

I have written piles of Django template tags for my own site, including a recursive control structure, a &quot;bind&quot; tag to do the same thing as the Jinja &quot;set&quot; tag, and many others... these are utility things really lacking in Django, and I have to say the more I work with Django the more it feels like a real lack.

A couple patterns are really common when writing template tag libraries for apps. One is a tag which calls a function and branches based on the result, e.g., to test user privileges. I rewrote this tag so many times that I developed a generic function caller control structure. Probably the biggest one, though, is writing tags that do a database lookup and bind a data structure to a variable for off-side content that isn&#039;t related necessarily to the main content of the page and therefore inconvenient to handle in every view.

This is a bloody massive amount of overhead for what turns out to be an extremely common task. In Jinja, though, you can bind axctual functions to the context and by using the set tag and calling the function retrieve and this kind of information in the template. With Django integration, you could use context processors to place the necessary functions in all contexts and presto, vastly less boilerplate to achieve this common and simple objective.

I mostly really like Django and even the Django templates, but I&#039;m thinking twice right now.</description>
		<content:encoded><![CDATA[<p>This article: <a href="http://lucumr.pocoo.org/2008/9/16/why-jinja-is-not-django-and-why-django-should-have-a-look-at-it" rel="nofollow">http://lucumr.pocoo.org/2008/9/16/why-jinja-is-not-django-and-why-django-should-have-a-look-at-it</a> makes a very persuasive technical argument why the Django template system is deficient and why the Django people should at least take a look at Jinja.</p>
<p>I have written piles of Django template tags for my own site, including a recursive control structure, a &#8220;bind&#8221; tag to do the same thing as the Jinja &#8220;set&#8221; tag, and many others&#8230; these are utility things really lacking in Django, and I have to say the more I work with Django the more it feels like a real lack.</p>
<p>A couple patterns are really common when writing template tag libraries for apps. One is a tag which calls a function and branches based on the result, e.g., to test user privileges. I rewrote this tag so many times that I developed a generic function caller control structure. Probably the biggest one, though, is writing tags that do a database lookup and bind a data structure to a variable for off-side content that isn&#8217;t related necessarily to the main content of the page and therefore inconvenient to handle in every view.</p>
<p>This is a bloody massive amount of overhead for what turns out to be an extremely common task. In Jinja, though, you can bind axctual functions to the context and by using the set tag and calling the function retrieve and this kind of information in the template. With Django integration, you could use context processors to place the necessary functions in all contexts and presto, vastly less boilerplate to achieve this common and simple objective.</p>
<p>I mostly really like Django and even the Django templates, but I&#8217;m thinking twice right now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: neil</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-20796</link>
		<dc:creator>neil</dc:creator>
		<pubDate>Thu, 21 May 2009 23:02:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-20796</guid>
		<description>i never comment on articles but for some reason feel like doing it, so here we go...

while probably sufficient for most web development, the django template language lacks the standard functionality desired for an application, mainly a complete set of conditionals and operations and the ability to easily pass arguments to function calls.

this is necessary because templates house the app rendering content, and need to make decisions about what to show the user by examining and processing the context that is passed. 

this gets very messy and laborious without complete logic, operations and function calls - you end up writing a lot of functions to create strings the templater is too awkward to produce and having to pre-compute series of flags in views to add to the context for operations that are a pain to do in the template. this causes problems when multiple views render the same template - you end up with a &#039;respond&#039; layer in-between that processes the context and generates the strings and flags the template needs - added complexity and dependency with little or no added value.

again, these issues are probably minor or negligible for most django web projects, but they become debilitating for applications (our typical small app is 100-200 source files).

i&#039;m just checking out jinja, but after one app on the django template engine, i realized it wasn&#039;t a viable solution for an application scale project.

oh, and it&#039;s slow as all hell.</description>
		<content:encoded><![CDATA[<p>i never comment on articles but for some reason feel like doing it, so here we go&#8230;</p>
<p>while probably sufficient for most web development, the django template language lacks the standard functionality desired for an application, mainly a complete set of conditionals and operations and the ability to easily pass arguments to function calls.</p>
<p>this is necessary because templates house the app rendering content, and need to make decisions about what to show the user by examining and processing the context that is passed. </p>
<p>this gets very messy and laborious without complete logic, operations and function calls &#8211; you end up writing a lot of functions to create strings the templater is too awkward to produce and having to pre-compute series of flags in views to add to the context for operations that are a pain to do in the template. this causes problems when multiple views render the same template &#8211; you end up with a &#8216;respond&#8217; layer in-between that processes the context and generates the strings and flags the template needs &#8211; added complexity and dependency with little or no added value.</p>
<p>again, these issues are probably minor or negligible for most django web projects, but they become debilitating for applications (our typical small app is 100-200 source files).</p>
<p>i&#8217;m just checking out jinja, but after one app on the django template engine, i realized it wasn&#8217;t a viable solution for an application scale project.</p>
<p>oh, and it&#8217;s slow as all hell.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robert Thomson (rmt)</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-20556</link>
		<dc:creator>Robert Thomson (rmt)</dc:creator>
		<pubDate>Thu, 11 Dec 2008 09:55:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-20556</guid>
		<description>I managed to get Django generics to play nicely with Jinja2. Here&#039;s my code: &lt;a href=&quot;http://www.djangosnippets.org/snippets/1241/&quot; rel=&quot;nofollow&quot;&gt;http://www.djangosnippets.org/snippets/1241/&lt;/a&gt; ... now, I wonder how hard it would be to make an {% extendsjinja %} tag for Django templates (or the ability to have Django recognise a particular template as Jinja, and just play nicely) ... that would make integration of third party apps a breeze.. I&#039;ll leave that one for when I&#039;m reaaaally bored though. :-)</description>
		<content:encoded><![CDATA[<p>I managed to get Django generics to play nicely with Jinja2. Here&#39;s my code: <a href="http://www.djangosnippets.org/snippets/1241/" rel="nofollow">http://www.djangosnippets.org/snippets/1241/</a> &#8230; now, I wonder how hard it would be to make an {% extendsjinja %} tag for Django templates (or the ability to have Django recognise a particular template as Jinja, and just play nicely) &#8230; that would make integration of third party apps a breeze.. I&#39;ll leave that one for when I&#39;m reaaaally bored though. <img src='http://www.davidcramer.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cassie</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-19889</link>
		<dc:creator>Cassie</dc:creator>
		<pubDate>Sat, 17 May 2008 14:29:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-19889</guid>
		<description>hi David I was wondering if you were the David Cramer from Illinois that is in CYT. DOn&#039;t think I&#039;m stalking you I am from CYT and I was wondering if I googled names from CYT they would come up. Just wondering.</description>
		<content:encoded><![CDATA[<p>hi David I was wondering if you were the David Cramer from Illinois that is in CYT. DOn&#8217;t think I&#8217;m stalking you I am from CYT and I was wondering if I googled names from CYT they would come up. Just wondering.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-19718</link>
		<dc:creator>Justin</dc:creator>
		<pubDate>Sun, 30 Mar 2008 19:51:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-19718</guid>
		<description>There are a couple of great Jinja features that David left out.

First is macros, with support for recursion. Writing template code for producing trees is difficult, making it tempting to produce markup in a view or templatetag. That&#039;s a pretty glaring omission on Django&#039;s part, IMO. Jinja&#039;s loops support recursions too.

The second is that with a normal parenthesized parameter syntax, you can pass more than one argument to a filter or method. This is absolutely necessary for for some kinds of filters which in Django have to parse an argument string. The filter syntax is nice looking, but without parentheses it&#039;s very limited to a strict left-to-write precedence rule. This also encourages more view logic and templatetags.</description>
		<content:encoded><![CDATA[<p>There are a couple of great Jinja features that David left out.</p>
<p>First is macros, with support for recursion. Writing template code for producing trees is difficult, making it tempting to produce markup in a view or templatetag. That&#8217;s a pretty glaring omission on Django&#8217;s part, IMO. Jinja&#8217;s loops support recursions too.</p>
<p>The second is that with a normal parenthesized parameter syntax, you can pass more than one argument to a filter or method. This is absolutely necessary for for some kinds of filters which in Django have to parse an argument string. The filter syntax is nice looking, but without parentheses it&#8217;s very limited to a strict left-to-write precedence rule. This also encourages more view logic and templatetags.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-19717</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Sun, 30 Mar 2008 19:15:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-19717</guid>
		<description>I don&#039;t see much reason to consider replacing Django&#039;s tightly integrated template system with an external, un-official one. The reasons listed in this article are vague and lack any backing.

I&#039;m not trying to flame here, but I really don&#039;t see what Jinja can do for me that Django can&#039;t. I don&#039;t think you should ever have Python code or extensive logic in template files, either.

Again, no flame intended, but one has to be really careful when telling new (or old) Django developers that something is better when there isn&#039;t much here to substantiate that notion.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t see much reason to consider replacing Django&#8217;s tightly integrated template system with an external, un-official one. The reasons listed in this article are vague and lack any backing.</p>
<p>I&#8217;m not trying to flame here, but I really don&#8217;t see what Jinja can do for me that Django can&#8217;t. I don&#8217;t think you should ever have Python code or extensive logic in template files, either.</p>
<p>Again, no flame intended, but one has to be really careful when telling new (or old) Django developers that something is better when there isn&#8217;t much here to substantiate that notion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-19716</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 30 Mar 2008 13:40:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-19716</guid>
		<description>Django isn&#039;t that much safer than Jinja. Both are fully sandboxed, Jinja just allows you to do more in it than Django, without extra hassle with template tag creation etc..</description>
		<content:encoded><![CDATA[<p>Django isn&#8217;t that much safer than Jinja. Both are fully sandboxed, Jinja just allows you to do more in it than Django, without extra hassle with template tag creation etc..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.davidcramer.net/code/113/using-jinja-with-django.html/comment-page-1#comment-19715</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Sun, 30 Mar 2008 13:37:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.davidcramer.net/?p=113#comment-19715</guid>
		<description>David, I mean that risk of injecting harmful python code into templates is bigger than not to allow python code in templates directly. 

And again, I don&#039;t see any valuable (for me of course) reasons to switch to Jinja. So all others reasons are more subjective than objective.</description>
		<content:encoded><![CDATA[<p>David, I mean that risk of injecting harmful python code into templates is bigger than not to allow python code in templates directly. </p>
<p>And again, I don&#8217;t see any valuable (for me of course) reasons to switch to Jinja. So all others reasons are more subjective than objective.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
