Simon Willison’s Weblog

Subscribe
Atom feed for chris-lamb

2 items tagged “chris-lamb”

2010

Appending the request URL to SQL statements in Django. A clever frame-walking monkey-patch which pulls the most recent HttpRequest object out of the Python stack and adds the current request.path to each SQL query as an SQL comment, so you can see it in debugging tools such as slow query logs and the PostgreSQL “select * from pg_stat_activity” query.

# 2nd June 2010, 9:09 am / chris-lamb, debugging, django, orm, postgresql, python, sql, recovered, monkeypatch

2009

GeoDjango and the UK postcode database. Excellent introduction to GeoDjango using the recently leaked UK postcode database. Obviously, you should only follow the steps in this tutorial using the officially licensed database, available for a mere £1,700.

# 30th September 2009, 2:25 pm / chris-lamb, django, geodjango, gis, postcodes, uk