The Little Python That Could

I've been pursuing my old NewWikiMigration project, and it's pretty much settled that I'll be aiming at replacing this site's Apache/ combo with an all-, filesystem-oriented approach. The reasons are manifold, but I can summarize them here again as follows:

  • I need a smaller, tighter codebase (PhpWiki is huge, and the drastic re-plumbing I've been doing over the past couple of years hasn't helped). Something I can build upon.
  • I want something that runs fast while using the smallest possible amount of system resources.
  • I want something with a built-in web server for:
    • Portability ( runs everywhere, and much better than ).
    • Security reasons (scripting language based servers are harder to attack and easier to instrument against attacks).
    • Tweaking every single aspect of the connection (from caching to compression, as well as request throttling, IP banning, etc.)
  • I want something that I can simply copy across to another machine - no databases, no special requirements, just (and for Wiki versioning). Zero deployment time.

So I started looking around for suitable bits of code to kick-start my new setup. In my usual strife for completeness, here's what I churned through, in more or less chronological order:


Like, you've got to be kidding, right? It's monstruous, and the only bits I would use from it are related to medusa and ZServer. Still, I gave it some thought:


  • Near-fanatical following.
  • Does it all, from Wikis to photo albums.
  • Truckloads of documentation.


  • Near-fanatical following.
  • Too big, complex, fiddly to use and customize.
  • Large codebase, steep learning curve.

Next contestant, please.


Sheer power. I've come across it many times before, and would not hesitate to base real-life applications on it. nevertheless, it is a bit too much for what I intend.


  • Stable, mature solution.
  • Web server does 1.1, chunked transfers, SSL.
  • Reasonably well-documented, active developer community.


  • Large codebase, steep learning curve.
  • Moving target (portions in flux).
  • A bit too demanding in terms of footprint.

So I went back to basics, and started looking at smaller stuff.


Extremely lean and mean server framework, with a very neat conceptual approach. I keep coming back, but after spending a couple of hours trying to add gzip compression, I've found it less than intuitive to extend, and couldn't yet figure out how to manipulate request headers.


  • Fast. Real fast, probably the best web server ever.
  • Supports 1.1, chunked transfers.
  • Good conceptual design.


  • A bit too low-level.
  • Codebase is pretty much dead in the water.
  • No working gzip support.

Moving up the ladder, I started looking at slightly more complex stuff with templating support.


This was the first "light" application server I looked at, and it kind of set the tone for the rest of my search. It was simple, neat and effective, although in need of a bit more polish.


  • Templating, session, authentication, internationalization support.
  • Enough of a mix between object orientation and templating for real-life work.
  • Small code base.


  • Simplistic web server based on BaseHTTPServer. No gzip support, no 1.1 features, etc.
  • Small developer community (almost no activity on mailing-lists).
  • Documentation needs some work.


With this one, I felt I was getting closer. It was slick, relatively easy to get into, and had a small active developer community, but somehow I couldn't get to grips with the coding philosophy.


  • Fast, multi-threaded web server.
  • Small, readable codebase.
  • Active developer community.


  • server not quite all there yet (although I've seen patches for 1.1, SSL and gzip support).
  • Not enough samples for me to quickly get to grips with a couple of concepts.
  • A bit too much assembly required.


This one was the little hidden jewel. Besides a very neat, servlet-like approach, it has a central administration console that lets you restart/reload running applications, as well as a small, manageable codebase. It requires quite a bit of work on the optimization front, but hey, that's one of the things I've always wanted to do.


  • Very slick web administration, drop-in registration of modules, on-the-fly updating, etc.
  • Nice, small, neat, almost Zen-like codebase with adequate documentation.
  • Seems to be completely UTF-8-clean (or transparent).


  • No 1.1 support, no gzip encoding, etc.
  • Tricky to debug some snakelet issues (might be just me).
  • Ony one developer (bug-fixing will take time).


So, until I find something better, I'm going to have a go at Snakelets. If you happen to find something along these lines (simple and with a good implementation), feel free to drop me a line.

This page is referenced in: