For all the wrong reasons, but still! I just love the fact that it actually uses a .html extension. Am I weird? I do feel a bit weird that I like something so arb. So the template files use the extension of what it actually contains? Wow, I love that. Revolutionary. Don’t ask me why I just thought of that… I cannot answer that truthfully :P Feels like I’m being anal, since it doesn’t seem to matter to anyone else. Most other web development frameworks uses other file extensions. For example in PHP frameworks, the template files have a .php extension. Must be this glorious Rocktober day in Cape Town that is doing this to me!
Hi there! You should subscribe to my RSS feed here.
You should follow me on Twitter here
You should follow me on Gatorpeeps here.








Robin 12:12 pm on October 2, 2009 Permalink |
You need a beer and weekend buddy!
Stii 12:14 pm on October 2, 2009 Permalink |
you said it! i’ll do just that…
Walter 12:20 pm on October 2, 2009 Permalink |
For me the .html extension is actually technically incorrect: it does not, in fact, contain (only) HTML and therefore invalidates (normally safe) assumptions associated with the extension.
Still, this really isn’t big enough of an issue to feel strongly about it either way. :)
Have you compared Django’s templating system with others? Not that I can speak from experience, but I’ve heard that it’s quite lacking in comparison.
Stii 12:40 pm on October 2, 2009 Permalink |
LOL, see what I mean?!
Yes, you’re right, its not technically correct, but if you consider what it is supposed to do (i.e. render HTML) it makes more sense.
I have and yes, it is quite lacking compared to other Python template systems. Then again, for good reason.
Charl van Niekerk 3:50 am on October 3, 2009 Permalink |
Personally the file extensions don’t bother me too much but I have to say that having to use straight PHP templating is just too messy for me. I would much rather use {{ myvar }} and have autoescaping turned on than having to type every time.
In App Engine I use Django templates all the time and in PHP I use Calypso. It integrates very nicely with Zend Framework.
Charl van Niekerk 3:52 am on October 3, 2009 Permalink |
Mmm ok, seems like your comment system just ate my PHP code block between “type” and “every time”. :)
?php echo htmlspecialchars($myvar); ? (leaving the brackets off this time)
Henrique 10:44 pm on October 26, 2009 Permalink |
Sorry, but you’re somewhat confused. Django doesn’t enforce any extension for template names – in fact, the template name and extension won’t influence anything at all as the result is just a big string to HttpResponse.
Your templates can end in .html, .xml, .pony, doesn’t matter. It’s just a file with placeholders.
Stii 10:53 pm on October 26, 2009 Permalink |
No, that is true. However, PHP has to have .php unless you’ve setup your web server to parse other file extensions as PHP. In Django it doesn’t matter, but it is common practice, no?
Really, it doesn’t matter, but it is one of those small things that amuse my small mind ;)
Kenny Meyer 1:44 am on February 12, 2010 Permalink |
I think Django templates’ syntax is much cleaner and readable than PHP syntax is. It may not be so flexible like PHP templates, but Django template’s syntax was designed for Designers (non-programmers), providing just simple logical stuff like for-loops, if-else-conditionals, and some other stuff.
But you can easily extend the syntax (!!) or replace the template engine completely by a more flexible one.
Now tell me if PHP can do that. ;)
Smile and laugh :)