Template Inheritance in Django (aka The Django equivalent of a Rails layout)
by David Orkin on Oct.06, 2009,under Python, Django, Ruby on Rails
Whew, I was worried there for a second. Coming for the rails world, Im very familar with layouts and partial templates, something that I thought was completely missing from Django but I am so happy to be proven wrong. Thankfully there is a rather simple way to do this using Template Inheritance which allows for a template to extend another template, and then, using their block syntax, overwrite portions of the template that its extending. Another classic example of why the term RTFM was coined in the first place. Ok, now I get back to work on launching that Django application I've been working on!
1 comment
This post has 18 feedbacks awaiting moderation...
Leave a comment