Wednesday, March 28, 2007

Checking out Pylons

Over the last few days I've been evaluating Pylons, because I'm having some trouble making TurboGears behave with SQLAlchemy.

The first thing that I noticed, was the awesome thru-the-web-debugger which pops up in your browser when your code raises an uncaught exception. Wow. That's gonna come in handy.

The other great thing is that Pylons doesn't try to look after your database for you. You've got to handle all that yourself, which is great, because I want to be responsible for that code. The good news is that most of my TurboGears model could be copied straight over into Pylons, and it just worked.

One thing I don't really like about Pylons, is routes. I know I'm going against the grain here, but I prefer to override CherryPy's .default method rather than write a bunch of strange looking rules. In the end, thats probably what I'm going to do with routes. Just route every request to my own dispatch method, which, even though some may consider it hairy, provides a cleaner URL. I don't believe http methods belong in a RESTful URL, which is what routes seems to want to do.

3 comments:

Ben Bangert said...

If you're looking for REST, that is in Routes and there's a Pylons controller template to give you a good head-start.

Routes information on RESTful resources and then try paster --help restcontroller inside your project directory to see how to have it create a RESTful template controller. Routes has quite a bit of REST-based evaluation, allowing you to conditionally dispatch to your controller's actions based on the HTTP method.

Cheers,
Ben

fumanchu said...

You should also check out bare CherryPy, which makes no assumptions about your DB layer. CherryPy 3 completely decouples and objectifies handler dispatch, so you can tweak that part to your religious heart's content. ;) See http://www.cherrypy.org/wiki/PageHandlers and http://tools.cherrypy.org/wiki/CustomDispatcher

Batok said...

What about cleverharold ?

Popular Posts