Archive for the ‘Django’ Category

Django: Template Inheritance

Monday, March 10th, 2008
Coffee Beans

In an effort to get some work done on personal projects, I decided that I need to program them in a language I enjoy more than PHP. The idea is that it will seem less like work and more like fun. It seems to be working so far, though there’s always a bit of a learning curve to get used to a new framework.

Speaking of frameworks, I chose Django, since it seems pretty mature and well thought-out.

One of the things that really strikes me as a really good idea (aside from ORM done right and and awesome automatic admin interface) is the concept of “template inheritance”.

Template inheritance allows you to define a base template with blocks, and then in “child” templates, to simply override those blocks which you wish to replace. This really helps to reduce the amount of template code, and even the number of template files, that you have to write.

(more…)

What I'm Listening to

Loading...