Note that there are some explanatory texts on larger screens.

plurals
  1. POTemplate system or language for Python (primarily HTML)
    text
    copied!<p>I'm looking for a mature, easy-to-use, powerful, stand-alone, "beautiful" template system/language for Python. I'm primarily interested in generating (static) HTML from HTML sources (so Markdown/RST/Textile aren't relevant).</p> <p>There seems to be an array of choices (the Python wiki has <a href="http://wiki.python.org/moin/Templating" rel="nofollow">a very long list</a>), which makes selecting quite daunting. The following are the languages I've heard of or used, ranked by my personal level of familiarity.</p> <p>Feel free to make this into a community wiki, if there's interest.</p> <h1><a href="http://docs.djangoproject.com/en/dev/topics/templates/" rel="nofollow">Django</a></h1> <p>Pros:</p> <ul> <li>Familiar and easy syntax if you've used Django.</li> <li>Django's awesome documentation.</li> <li>Much separation from logic.</li> <li>Actively supported and maintained.</li> </ul> <p>Cons:</p> <ul> <li>Not really made to be used in stand-alone mode. I don't even know if loading template tag libraries work if you don't have any <code>INSTALLED_APPS</code>.</li> <li>Tied to the schedule of the entire Django project makes stand-alone usage fuzzy.</li> <li>Perhaps overly non-Pythonic syntax.</li> </ul> <h1><a href="http://jinja.pocoo.org/" rel="nofollow">Jinja2</a></h1> <p>Pros:</p> <ul> <li>Syntax is essentially Django++</li> <li>Configurable syntax</li> <li>Well-maintained</li> <li>Good documentation</li> </ul> <h1><a href="http://genshi.edgewall.org/" rel="nofollow">Genshi</a></h1> <ul> <li>XHTML:ish syntax (good or bad?)</li> <li>Therefore locked into generating XML based output?</li> <li>Possible to use Python directly in templates (<code>&lt;?python ... ?&gt;</code>)</li> </ul> <h1><a href="http://www.makotemplates.org/" rel="nofollow">Mako</a></h1> <p>Pros:</p> <ul> <li>Backed by Pylons, deployed on sites like reddit.com</li> </ul> <p>Cons:</p> <ul> <li>The syntax (from a quick glance) strikes me as a bit uneven. <code>&lt;%</code>, <code>%</code>, and <code>$</code>?</li> </ul> <p>Some things that I think are worth considering are also:</p> <ul> <li>Python 3 compatibility</li> <li>Editor support (Are there maintained TextMate bundles, for example?)</li> </ul> <hr> <p>I admit I don't know anything about the following, except that they have ugly websites.</p> <h1><a href="http://www.cheetahtemplate.org/" rel="nofollow">Cheetah</a></h1> <h1><a href="http://www.stringtemplate.org/" rel="nofollow">StringTemplate</a></h1>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload