You are writing a comment about Replacing Django's Template Language With Jinja2, here is a quick summary:

The first example in the Loosely Coupled Django series, this entry looks at replacing Django's template language with the freshly released Jinja2 template language.


You are responding to this comment written by Will Larson on July 22nd 2008, 17:16.

James,

Unfortunately this was unclear because I boneheadedly left out the index view. Jinja2, like the standard Django templating system, can find templates using an path from the base template directory. Thus the code to render the template here is like this:

return render_to_response('with_jinja/index.html')

and the template locator thus checks for the file at these two locations:

os.path.join(ROOT_PATH,'templates/with_jinja/index.html')
os.path.join(ROOT_PATH,'with_jinja/templates/with_jinja/index.html')

So, it can find files in subdirectories, if you explicitly tell it to do so. Let me know if you have any other questions.


Please be aware that comment forms go stale after one hour.





Comments may make use of LifeFlow MarkDown. Raw html will be escaped.


Quick Introduction to LifeFlow MarkDown Syntax

A highlighted code block:

@@ ruby
def a (b, c):
  b * c
end
@@

Other common languages work as well: scheme, python, java, html, etc.

Other markdown syntax:

 ### This is an h3 title
#### This is an h4 title
**this is bold**
*this is italics*

1. This is an
2. ordered list

* And an unordered
* list too

[this is a link](http://www.lethain.com/ "Lethain")