Myghty is mighty interesting
Everyone has their own favorite templating engine these days on Python. I have tried Cheetah and Kid, and found both of them lacking in terms of features. I am having a lot of problems with Kid templating system, when I work on TurboGears. Kid is throwing up a few errors, and although it kind of forces me to write good XML, I think the system gets a bit too mean. However Kid has limitations, and for the pain I guess it is not worth it.
Pradeep Gowda of btbytes.com fame pointed me to Myghty and I am starting to appreciate it. Myghty is based on Mason, which helps you to embed Perl in HTML.
From the Myghty web site
"Advantages of Myghty
· 100% support for all of HTML::Mason's industry-proven featureset, and more
· A flexible and extensible caching system comes built-in, available at the component, page, and superpage levels through simple tags, or programatic access anywhere. Supports memory, file, DBM and memcached backends.
· Templates embed 100% real Python, Python control structures, Python whitespace
· Real .py and .pyc modules generated on-the-fly
· mod_python, CGI, WSGI support built-in, tested, on the road right now, including with FCGI, Lighttpd and Python Paste - runs standalone out of the box too. Also supported with CherryPy and Turbogears via the BuffetMyghty template adapter.
· Built-in Session support for all platforms - doubles as a drop-in replacement for mod_python's session, also supports file and memcached backends.
· The only place in Python where you'll get the original template inheritance model - the most widely used and feature-rich
· Unique Module Components system allows any arbitrary function or object method within a Python module to intermix with templates freely, or be mapped to URL resolution - they are the ideal environment-agnostic MVC controller
· A ruleset-driven Resolution engine, the only one of its kind - resolves components based on paths, regular-expressions, across multiple directory structures and even within modules and their attributes. Create logic-driven chains allowing unheard-of amounts of URI resolver flexibility, and add your own rules. Myghty's resolver can match any URI to any code or template - guaranteed."
I will write a very small Myghty example in next blog to illustrate the power of Myghty.