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).
There seems to be an array of choices (the Python wiki has a very long list), which makes selecting quite daunting. The following are the languages I've heard of or used, ranked by my personal level of familiarity.
Feel free to make this into a community wiki, if there's interest.
Pros:
Cons:
INSTALLED_APPS
.Pros:
<?python ... ?>
)Pros:
Cons:
<%
, %
, and $
?Some things that I think are worth considering are also:
I admit I don't know anything about the following, except that they have ugly websites.
Sorry, don't have the rep yet to leave comments, so I'll leave this as an answer.
I've only used django and mako. Seems like the primary difference between these two template languages is that Django is designed as if you can't really trust the template designers. You can see this in how they limit the code you're allowed to use in templates, and they don't allow python code within a template. (Cue debate on whether python code belongs in a template or not). For my projects, I was both the programmer and designer, so Django got in my way.
Mako simply parses the template into blocks of text and python code, with some helper functions. This means that Mako's code is much much smaller, and it seems to be much faster to learn than Django, assuming you're already familiar with python.
For example: The only way I could find to assign a variable in django was using a with block:
{% with total=business.employees.count %}
{{ total }}
{% endwith %}
(Note that business.employees.count is actually a function (business.employees.count())).
Whereas the equivalent code in Mako would be:
<% total = business.employees.count() %>
${total}
Django gurus: Feel free to correct me. I have limited experience, but this was why I switched off of Django to Mako.
This seems to be a pretty decent base comparison of the different templating systems, if you just want to get an idea of the syntax: http://catherinedevlin.pythoneers.com/cookoff.html