If Django templates are an improvement over XML templates, then, by all means, please give me XML
I fail to see how
{% block %}
...
{% endblock %}
is in any way better or "less scary" then, let's say
<dj:block> ... </dj:block>
Yet another rant, this time triggered by the error I got when writing this piece of code:
{% blocktrans with offer.offerer.username as offerer_username
and offer.offered_time|date as offerer_date %}
...
{% endblocktrans %}
I just wanted to split the tag on multiple lines, but it seems that's not possible. If Django templates would have been XML, then it wouldn't have been any problem formatting that piece just how I want it. Right now, the joined line takes two times the amount of my screen width.
One more thing to grudge about is that vim, even with djangohtml syntax type installed, is not very knowledgeble about how to format the template file (it treats the tags as regular piece of text). Probably this could be fixed, so I shouldn't complain about this too much.
I think Django templates are compiled to python code, so it's natural that they're treated in an imperative, dumb way, but that's not the only way of doing things. For example, Chameleon is another templating library that compiles its templates as python code, has no problem working with an XML based templating language frontends.
My reply to your points
2. As a web developer, my templates will almost always end up as xhtml files. Dynamic resource files (CSS, JS) are very rare, as they can be tricky to get it right with regards to caching and almost always the thing that needs to change inside them can go in a regular template. The only thing that justifies having a plain text template would be email notification messages, but with the plethora of choices for templating libraries (or even Python builtins), it's trivial to find and chose a simple one for just that use case.
In the end, it all comes down to what you're used to. For sure both approaches are valid. As for never having encountered the problem I've exposed in the article, maybe you haven't dealt with i18n yet. Look at the example and tell me what I could differently.
If you want to put more XML in XML, then, by all means, do it!
2. XML templates are only good for generating valid XML. When using Genshi for example, you have to fall back to "text templates" which is a completely different syntax and far from XML, when you want to generate a JS file for example.
I don't get your argument. After writing tons of Django and Jinja2 template code over the years I've never faced a similar formatting problem. And this is from someone who's a code formatting nazi.