Thursday, September 10, 2009

DjangoCon (Day 3)

Our keynote speaker this morning is Ted Leung from Sun Microsystems. He's giving us the 10,000 foot view wherein DjangoLand is but one domain among many, albeit a robust one (he likes our Pony, currently at the front of the room, enwrapped by you know who).

We're looking at some of the Erlang competitors, though not in much detail, such as Nitrogen and Webmachine. Then of course there's Lift, written in Scala, a JVM language, with brilliant support for Comet. Not everyone is using Python for everything, so true. Some are using Jython.

Kirby's aside: So WTF is Comet? Checking... OK, basically AJAX on steroids, doesn't stand for anything, means the server might be aggressive about updating its clients, doesn't lazily wait for http requests. More of a udp datagrams model. Think of a multi-user game environment (business lingo: multi-user collaboration tool) wherein every player needs frequent updates, even if only passively. Think of Twisted, already a basis for such global game playing.

Chris McAvoy, on cold meds, is talking about Django on Jython. Most attenders have flooded the "scaling your django applications" in the room next door, now that the ballroom has divided in half (I say ballroom somewhat sloppily, as there's no ball in here, let alone a hexapent version).

He's suggesting JRuby and JPython define an Enterprise-y web framework that's more agile than the usual Oracle, "portal", Websphere kind of stuff. "We're all ops people now" in the sense that writing the app is now the easy part. It's the Apache / mod_wsgi crap that's killing us. So how is Django on Jython an answer?

Pip django-jython to build WAR files, get the zxJDBC package for chatting with Postgres, SQLlite (MySQL still in the works -- ironic given Sun's position here). Sequence: use virtualenv, install pip, pip install Django 1.1, install patch django-jython. http://bit.ly/django-jython-fix for Django 1.1, delete settings$py.class if you're using 1.0 for some silly reason. Forget about models.ImageField -- you won't have PIL. If PIL moves to ctypes... doj.backends.zxjdbc.postgresql will be your database_engine in settings.py (for example). jython manage.py war is going to roll up your stuff for throwing over the wall to admins (for deployment).

Andy McKay is giving a fascinating talk about his trip to Kenya in support of health care workers, originally using Rapidsms, similar to Twitter on cell phones. Kenya has great cell phone coverage. He's learned a lot about malnourishment. "Robbed of vital nutrients as children they grow up stunted and sickly, weaklings in a land that still runs on manual labor." (NYT).

Andy helped wire Django in as the switchboard for sms messages in the field, forwarding to the clinic. An Eee PC running Ubuntu is the server. One of the bugs was in spomskyd, a Ruby daemon. pygsm has since replaced spomskyd ("Ruby rubbish").

Malaria was added to malnutrition, as another set of sms messages. He also branched out to Malawi. from rapidsms.message import Message gives you the sms messages. urls.py makes routing sms commands easy -- so what these aren't urls. A non-standard use case, woo hoo. Class based views to the rescue when Malawi wanted a different command set -- just subclass. Here's some code.

Erich Ocean: HTML5 is a technical spec, but culturally its more a Flash killer. The beefy JavaScript engines are making a big difference. Dynamic languages win again (sorry Java). SproutCore is the HTML5 application framework adopted by and now developed at Apple. It's open source, like WebKit and LLVM. Erich thinks WebKit is the future for the browser, thinks Django is well positioned on the server side. Webkit will run on Windows. HTML5 is moving faster than many think. You'll be able to sneak WebKit in the back door into IE6 even. This talk relates to the anticipated future of low latency push apps that keep updating the browser without waiting for client-side requests i.e. like Comet (see above). HTML5 web sockets...

Dr. Russell Keith-Magee: No! Bad Pony! A "pony" is shorthand for "desirable feature" in some ways. "Daddy, I want a pony" might be a typical developer's feature request to the Django core developers. The core developers, being protective of the project's aesthetics, as well as being busy, often have to say "No!"

Lightning talks: lots of good stuff, James K. Tauber made use of Steve Holden's input to welcome us to the wider Python community, giving some sense of what Python Software Foundation is doing in the world. He gave a second lightning talk about how to pronounce "Django" -- very technical, plus 30 seconds over, meaning the Pony was thrown (raised an exception).