4 ms·
Throw out your templates (Use pure Python instead)
- mnemonik 16y agoThe manifesto is in the module's doc string. I met Tavis at Django Ski and he is a very cool guy!
- ibejoeb 16y agoOkay. I like that it's intelligently argued. It's just too much, though. I can't really ask even a talented web designer to do this: HTML5Doc( body(onload='func_with_esc_args(1, "bar")')[ div['Escaped chars: ', '< ', u'>', '&'], script(type='text/javascript')[ 'var lt_not_escaped = (1 < 2);', '\nvar escaped_cdata_close = "]]>";', '\nvar unescaped_ampersand = "&";' ], Comment(''' not escaped "< & >" escaped: "-->" '''), div['some encoded bytes and the equivalent unicode:', '你好', unicode('你好', 'utf-8')], safe_unicode('<b>My surrounding b tags are not escaped</b>'), ]))
- Luyt 16y agoThat's a kind of convoluted test case. The article also contains some more practical every-day examples.
- stevenwei 16y agoSorry, all of the provided examples are damn near unreadable. And what happens when you want to make use of template inheritance and block replacement?