Django templates really blow. It was my understanding the the Python philosophy was not to prevent the programmer from doing things; even if they were considered dangerous. But then the excuse for these hands-tied-behind-your-back templates is nullified -- the only possible reason to create them and have them be so limited and restricted is to prevent people from getting into trouble, as in by over-coding the View or something. Now, I understand how we don't want our pretty Python views to turn into PHP, but come on. If I need it, I should be able to get it. The only thing I can say is thank god for Mako; it was surprisingly easy to replace the native Django craplets with the far superior and flexible Mako, even on the unnatural and unforgiving GAE.
I thought I really liked Django, but having to work with these evil templates has turned me 180 degrees. Erb from Rails didn't have this evilness, not even JSF had this evilness -- with JSF you could either slip back into JSP, or write custom tags (with relatively little hastle). I don't even want to touch Django's "filter" bastardizations. Ick.
On the magicness scale, Django is certainly a step down from Rails, but until now I had thought that was a good step down, a step down that let the programmer more easily see behind the curtain (as it were). But having to work extensively with these Django templates has altered my opinion totally. When the framework stops working for me, and starts actively opposing my actions, it's time for a change.
Hurray Mako, boo Django. Maybe I ought to switch over to Pylons or Turbogears for a bit, see what those are like.
Thursday, October 9, 2008
Subscribe to:
Post Comments (Atom)

2 comments:
Yeah. They are so horrendously unpythonic and down right god-aweful! What we have done here is to fork Django, and completely replace the template system with Mako. Everything has been replaced. All the admin templates are now rewritten in mako, allowing you to override them with mako sub templates.
Along the way we have improved admin with a lot of functionality that the django team have flat out refused to implement (like distant field filters). We got sick of being rejected so we are taking Django in a new direction.
We would love to get some users so we can start exercising the code and fixing any bugs.
Come join the Mango revolution:
mango-py project
Post a Comment