17

Sep

Filed in Django |

The author of Jinja, an alternative solution to Django templates, made a great post about what is wrong with the Django template engine. It’s a great read if you have any doubts that the philosophy behind Django’s template engine makes sense.

The truest quote of them all:

I like the custom tag system in Django, and I wouln’t want to see it go away if the template engine is improved. But for example “ifnotequal foo bar” “endifnotequal” is no way better than “if foo != bar” “endif”.

  • http://www.red4.bz israel

    I agree, the ifnotequal stuff confused me at first when i started off with Django templates. i mean, if is a standard across many languages and i think is needed in a templating system.

  • http://www.mocksoul.ru/ MockSoul

    We philosophy behind “ifnotequal” and similar confusing things – they are designed not for developers, but for html authors (which may or may not know python/other language at all).

    As an example: my sister clearly understands “ifnoequal A B means A not equal B” and do not understands “A != B” at all :) .

    Thus, django template engine actually 100% fits the idiom “template should be as easy as possible”. But not that much usable to make very complex template logic. Jinja also dont. Even plain “print’s” in python does not fit that (: And there is no product on the market which can be used to make very-very-very high performance web sites. Template engine implemented in C should be faster than plain python itself, isnt it?

    We (IPI Tech) want to make that thing in MIT license (of course! :) ). Currently it is in “think-think-think!” stage, so any comments are welcome. Especially from you, David (:. (jett in launchpad).

  • http://www.mocksoul.ru/ MockSoul

    “We”=”The” in the first sentence. Auch!

  • David

    You are correct in some of the assumptions MockSoul. On the other hand, most designers, or frontend developers, have to learn CSS and typically JavaScript as well. They usually understand != as it’s the most common representation in the web world.

    As for performance, Jinja can be used on a high traffic website just as well as something like Smarty can. Parts of it are written in C to speed up execution of things, and it also compiles templates down to python modules/bytecode (you’d have to harass the Pocoo guys for more information on how all this works, I’m unfamiliar).

  • http://www.mocksoul.ru/ Vadim Fint

    Yes, David, I know jinja internal structure a lot. I’m also know Pocoo is a very great development team. Jinja is working just like smarty (php) or mako templates (python). But that is not enougth.. :)

    Words cant change the world, so.. just take a look into “jett” project at launchpad in next 3-4 months.. ;) I’m not promising it will support all jinja/django features. Also that possibly will not be extendable in such easy way as python template engines… but.. it will be FAST.

  • http://www.mocksoul.ru/ Vadim Fint

    Btw, js in html or heavy css – is “complex templates” in django terms.. :) . I have no idea how somebody without js/css knowledge can make complex web site.

    But, again, django template engine is designed for _simplier_ websites. Maybe without js at all. Thus, person who may edit such easiest templates may NOT know about “!=”.

    Note that I personally dont like django template philosophy at all.

  • http://www.chaneloutletstores.com chanel outlet

    It's wonderful to read about a female poet coming of age in this era, especially with Anne Sexton as a mentor for a short while, but so many other poetic luminaries as well. I'm also finding it encouraging to know, being 38 myself, that one can jumpstart her career at this age. Thank you for this inspiring interview, Julie Kane. http://www.Like-Acer.com
    write's unique point.It is useful and benefit to your daily life.You can go those
    http://www.chaneloutletstores.com

  • http://www.air-jordan-8.com/ air jordan 8

    Well , the view of the passage is totally correct ,your details is really reasonable and you guy give us valuable informative post, I totally agree the standpoint of upstairs. I often surfing on this forum when I m free and I find there are so much good information we can learn in this forum! http://www.globalcommuni-cation.com/

  • http://www.discount-coach-outlet.com coach outlet

    I am a gamer.When I come in the http://www.who-wanted.com post,Iloved it. Various pictures and perfect plot let me fall in love.If you love play game,you should come in.On the other hand ,there are some websites http://www.romantisongs.com content is very exciting,you can go and see.Like http://www.all-carefully.net

blog comments powered by Disqus