MacPython Logo from __future__ import *

buy music albums Silver Apples buy mp3 albums Tarrus Riley buy tracks mp3 Kravits buy Reaper albums mp3 buy Kravits albums music buy music Evita CD online albums mp3 Silver Apples download Madonna CD music buy tracks music Kravits download music albums Silver Apples

2005-09-17

TurboGears

Filed under: AJAX, MochiKit, javascript, python — bob @ 1:37 pm

TurboGears, "the rapid web development megaframework you've been looking for", has just been released. It's the first web framework (for any language) that includes MochiKit in its war chest. TurboGears looks cool because it leverages a lot of very good existing software and wraps it up in a very usable manner. It does not have NIH syndrome. It has excellent documentation and a very nice 20 minute wiki tutorial that covers the whole stack (all the way up to "AJAX" with MochiKit!).

There's a lot of good first impressions to be had with the technology:

  • It's not afraid to take advantage of Python 2.4 features (decorators)
  • Despite the fact that it has a bunch of dependencies, installation is painless as it's setuptools-based (eggs!)
  • It uses Kid for templating. XML in, XML out. This means your templates look like your output and can be tested (for validation, look and feel, etc.) with just a web browser. A web developer's dream come true! If you've used TAL (or ZPT) before, it's similar.
  • SQLObject is a pretty good ORM layer, with support for SQLite, MySQL and PostgreSQL. What's especially cool is that you don't actually have to use it, so if you have another way of doing your model layer you really don't have to change.
  • The model hooks up to the view by returning a dictionary. These dictionaries are either passed to Kid to render a template, or can be returned to the browser as JSON. There are plenty of other possibilities here (XML, etc.). Perfect for MochiKit integration!
  • It comes with a script to make a project using the default template, so a new project is not a blank slate. This is especially useful for new users.
  • CherryPy knows how to reload code and templates when they change on disk. This is probably my biggest pet peeve with some of the "competition". Boy do I hate restarting servers!
  • It supports all the important platforms (anything unix-like, including Mac OS X, and Windows).

It seems to be quite a complete package. I'd be a little more excited about it if it was built on top of Twisted, but it's probably possible to plug that in to an extent using CherryPy's WSGI support.

2 Comments »

  1. Have you tried nevow? It does use Twisted but I’d be interested to hear your thoughts.

    Comment by duncan — 2005-09-19 @ 8:25 am

  2. Yes, of course I’ve tried nevow. It’s not the same kind of product. It’s great for doing web stuff with Twisted, but:

    - You need to restart the server to reload code
    - I don’t really like the templating language as much as Kid or TAL
    - It doesn’t have enough polish (documentation, examples, nice web presence)

    That said, if I have a need for Twisted I’ll generally be using nevow (or even just twisted.web).. but that’s not really an option for most people. I can’t go to a freelance developer who is mostly experienced with something like PHP and tell them to use Nevow and expect them to make a deadline… but I think there’s a chance that I could with something like TurboGears (with a little help on Kid and Python syntax) given the excellent documentation and the “target demographic” being more than just hardcore Twisted hackers :)

    Comment by bob — 2005-09-19 @ 9:50 am

RSS feed for comments on this post.

Leave a comment

Powered by WP-Hashcash.

Powered by WordPress