OSCON 2007, Day 2

Python and WSGI

This morning I took Mark Ramm’s “Modern Web Development with Python and WSGI” tutorial. Mark had people build stuff during class, which was a great way to have these concepts sink in. I successfully built a little WSGI-powered site in just a few minutes. As Chas promised (but I didn’t actually believe him), it’s pretty simple stuff.

For a long while I’ve pointed people to Joe Gregorio’s Robaccia as a way to understand concepts behind web frameworks, and to get a sense of why you shouldn’t just dive in and make your own without grasping those concepts. Ironically, Joe’s “throwaway” framework has refused to die, and now it’s got a home on Google Code.

I chatted briefly with Mark and Ben Bangert afterward about WSGI and Django. They explained one basic architectural difference that I had missed, which is that while individual Django view functions expect to receive HTTP request objects and return HTTP response objects, the WSGI/Pylons model is based on global request and response objects. As I understand it this is the major sticking point in terms of WSGI-fying Django apps.

Time management

In the afternoon I took Time Management for System Administrators with Tom Limoncelli. Tom has written a book of the same name for O’Reilly. I’m a sucker for this kind of stuff, and Tom is a very good presenter.

He led the class through a paper (or “Personal Analog Assistant”) example of managing to-do tasks and calendar items, including notation for done/moved/rejected/delegated status glyphs for tasks, and a system for keeping the day’s tasks from expanding beyond available time. It seems that a significant part of this system, similar to agile development methodologies, is regularly reviewing progress and adjusting expectation and goals accordingly.

Some tips:

  • clear your to-do list at the end of the day; this makes sure nothing gets lost, and frees you from obsessively worrying over whether you’ve forgotten something
  • large projects can be broken into smaller to-do-able chunks; for very long projects you can add weekly milestones as well
  • priorities are not intrinsic to a task – they’re reassessed every day that a task is open, rising as its due date approaches
  • if you have something that needs to get done by the end of the day every day, schedule it early
  • start every day by planning

A lot of the techniques he outlined were familiar to me. One the one hand, this made me feel like I knew something. On the other, it made me think thoughts like, “If I’ve been using technique X for 15 years, how come I still have all this stuff on my list?”

Overall, though, it left me with that fuzzy optimistic feeling I get whenever I get inspired by the promises of a new system. As Fred Brooks says: all programmers are optimists.


Ian Bicking commented on Wed Jul 25 01:35:07 2007:

I think there’s some confusion about Pylons/WSGI and Django there. The request/response thing isn’t too big a problem with Django. Django has global configuration, not per-request configuration, which does cause some problems. And maybe there’s a problem that it has long-lived request objects that are modified in place, and can’t be easily turned into WSGI request environments. But I’m not sure. Nevertheless, there’s some confusion in there about the issues.


Paul commented on Wed Jul 25 02:27:15 2007:

Hi Ian, thanks for trying to puzzle that out. It’s pretty likely that the confusion is mine rather than Mark’s or Ben’s – I’m wading into WSGI for the first time and still mapping the distinctions. I’m going to keep going with it though, since I do believe it’s an important part of the web app landscape these days.

Too bad you’re not out here! We could use more Python in the proceedings.



Share: