Highlights from DjangoCon 2009
Long (long!) overdue, here’s a bunch of links that point to the good things I learned at djangocon.
Restful Ponies
- Started with a basic REST overview, gets interesting when it shows how you can easily expose resources using Piston
- django-roa builds on Piston to give models a basic REST API for free
- remoteobjects is an object-restational mapper that maps objects to REST apis on the web. It’s really cool and I’m playing with it for the new Bugzilla rest view.
Deploying Django
Talks about how they’re doing “repeatable, automated, isolated” deployments using Python tools. Don’t you wish we were rocking this on AMO?
- virtualenv and pip to keep the deployment environment isolated
- fabric to script vcs checkout and installation
- using lightweight tags in git to mark deployment versions
- up and down migrations with South to stay safe
- mod_wsgi daemon mode is preferred, fastcgi is cool too
Scaling Django
Pownce was serving hundreds of request/sec, thousands of db ops/sec, it can be done. It’s simple to do automatic caching and invalidation when your queries are going through the ORM, Django’s signals decouple the invalidation process from your update code. Using multiple databases with Django is not straightforward, but it’s getting easier with an SoC project that’s ready to merged in.
- sqlparse pretty prints SQL queries
The Realtime Web
Showed how they created an IRC client in the browser over comet with Django on the backend. The browser and the app keep “persistent” connections to an orbited server that handles all the messy details so the app can pretend it’s really connected directly to the browser.
This coincided with the release of FriendFeed’s Tornado web server, which led to an interesting focus on async during the conference.
Using Django in Non-Standard Ways
Covers a lot of little hurdles that people might consider show-stoppers when using Django, how to overcome them. WSGI middleware is fun:
- repoze.bitblt: automatically scales images
- repoze.squeeze: Merges JS/CSS automatically based on statistical analysis
- repoze.profile: Aggregates Python profiling data across all requests, and provides an html frontend for viewing the data
- repoze.slicer: extract/filter pieces of an html response
Pinax Tutorial
Pinax tries to be a collection of reusable apps that work well together, but it looks like you spend more time trying to configure things than actually making useful apps.