Saturday, October 14, 2006

Nevow for Rapid-Deployments

I think I remember Guido making the comment that Twisted and/or Nevow scared him. I also think that (ignoring the causal effects of his statement) many people feel the same way, and if those people saw this blog post, they'd say I was deluded.

I've been using Nevow (on and off) since fzZzy first presented it at PyCon2004. I've been blogging about it since a year after that.

My first "web framework" was shell-script-generated HTML in the mid-90s. Then I found PHP. Zope. Perl (Interchange and Mason). Plone. Then a whole string of custom solutions.

I tried Django when it first came out, and hated it. I tried it again recently, and was most pleased with the progress they've made. I'm using it on a project with some non-programmer folk who wanted to convert their application from PHP to Python (I couldn't sell them on twisted). After digging around in the Django code base, I can safely say I will probably enjoy myself while working on the project.

I've also been a fan of the z3 CA for a couple years, and disagree with much of Ian Bicking's recent assessment of it (and agree very strongly with Martijn's comments). I continue to do work with z3 and enjoy almost all of it (being able to pick and choose helps greatly).

But when it comes down to it, when I need to roll something out fast, and I can choose the framework without concern for such things as technical support, community popularity, buzz, or political considerations, I choose Nevow. Case in point, the project I mentioned in this post. 30 minutes to casually convert a project from z3 to Nevow.

Though important, development speed is not the only consideration to make. Everyone talks about how fast you can roll a project out in web framework X, etc. But there's something that has a much higher priority for me: how insane will it let me be? Can I do anything I want? Once it's built, can I plug "stuff" in and out? Can I make unexpected changes easily and quickly, without compromising the integrity of the architecture? And even more: can I build my own system(s) with it?

And that's where Nevow cinches it for me. I am the most comfortable with it's design, templating, internals, and programmer freedom. I feel I have a little more freedom and flexibility with it than I do with z3. Nevow provides me with the tools and comfort level to build my own systems easily, quickly, and extensibly.

As an example, take this work in progress.

I've built a couple game-world oriented sites in the past. The first one used PHP and the second two used Plone. In both cases, it was very difficult to easily manage what I wanted to manage. I learned a lot of lessons about how information management works for me. When I started working on Myðgarður, I put these lessons into effect. Nevow let me do that.

I have a highly customized brain that needs things done in a certain way in order to be maximally productive. I think lots of brains are like that ;-) I want a framework that reflects my brain's needs, not only to deliver a result quickly, but to deliver it in a way the fits me best... and can adapt to the future best.

As a side note, Nevow is going through an overhaul (more) right now that will not only improve its general efficiency, but will actually fit my brain even better. When the context-less Nevow is released, I plan on producing at least one screencast on how to go form 0 to 60 with it in less than 20 minutes.

So stay tuned...

Technorati Tags: , , , , ,


  1. Looking forward to the nevow screencast. I looked at the docs for it and didn't see the word database mentioned at all. I no nothing about twisted, nevow and very little about python itself, so maybe there is some other framework you use in conjunction with nevow to deal with a database. That's just what I noticed from the prospective of a complete outsider.

  2. I think there are two reason one could explain the lack of documentation for databases and Nevow:

    1) nevow is completely open-ended in that regard; you can get your data from anywhere, or

    2) it is poorly documented ;-)

    In truth, access to databases in asynchronous, event-driven systems can be a little tricky when most database drivers are synchronous. There is a twisted API for accessing databases, there is also twisted.internet.threads.deferToThread. Even better, though, there is a project that makes SQLAlchmey asynchronous. One of my personal favorites is Axiom. It's an object database written on top of SQLite and designed for use in async code.

    But I actually hate databases :-) I can get away with that prejudice in most of projects because many times there is no need to support the kind of access and availability dbs provide. Most of my projects have a small API for accessing plain text. The latest one actually stores textual information in RFC 2822 format.

    But that'a part of Nevow's beauty -- it doesn't matter where the data comes from: as long as your're comfortable working with async code, it can be as simple or as sophisticated as you need.