Tumblog archive for January
One-Line Browser Detection in Javascript
A single line of JavaScript that that determines the browser of the user. I generally don't use much browser-specific JavaScript these days, but it's nice to know this is there when it's needed. Via Ajaxian
http://www.thespanner.co.uk/2009/01/29/detecting-browsers-javascript-hacks/Full-text searching in Django with PostgreSQL and tsearch2
Recently, I have wanted to improve the searching ability in a number of my Django projects. I've often added a search box that simply does an icontains filter, which works fine for small sites but doesn't scale due to the inefficiency of matching text with basic SQL queries. The plus side of an icontains filter is that it works on all of Django's database backends (with the exception of SQLite, which works but in a case-sensitive way), so it can be useful for pluggable applications to implement. I wanted something that could do some heavier lifting, so I looked into tsearch2 - a PostgreSQL plugin that provides full-text indexing and searching that's twice as fast as standard icontains filters. On DjangoSites I managed to reduce my search queries to half their original time, with improved accuracy. Read the full article to find out how.
Django Site of the Week: ForecastWatch
Eric Floehr is the man behind ForecastWatch and ForecastAdvisor, two Django-powered weather websites that aggregate and analyse weather forecasts to compare their accuracy on an ongoing basis. This week, I spoke to Eric about the history behind his sites, how he handles massive data sets, and his conversion from Ruby on Rails to Django. You can read all about it over at the Django Site of the Week.
Django Site of the Week: ShutterCal
ShutterCal is a photo sharing site with a difference - it encourages contributors to upload one photo every day to help people reach a goal: whether that may be to improve their photography, watch themselves evolve over a year, or remember people and places they visit. ShutterCal started in 2007, and this week I spoke to developer Dan Ferrante to find out why he chose Django, some of the challenges he's faced, and how he uses Django and other open-source software to make his life easier. You can read more over at the Django Site of the Week.
Django SOTW Moving to Mondays
To better fit with both my own way of doing things and with general web browsing patterns of the Django SOTW public, I'm moving the SOTW to Mondays rather than Saturdays. Also, I've finally succumbed to the forces and I've joined Twitter so you if that's your kinda thing then come and say hi!
Rate Limiting in Django via memcache by Simon Willison
Simon Willison has published a fantastic code snippet that provides rate limiting for Django applications using memcache as a storage mechanism to avoid continuous database writes. A very useful addition to a Django project if you're unable to do HTTP throttling at the HTTP level (eg via Apache or your hardware routers/load balances) (via Simon Willison)
http://github.com/simonw/ratelimitcache/tree/masterDjango Site of the Week: Represent
Represent is a new website prototype from the New York Times that provides New York residents with information about the whereabouts of their elected representatives. What's interesting about this website is that it's one of the first large-scale sites to implement GeoDjango for spatially-aware applications. This week, I spoke with Derek Willis to get some details on their implementation of a Django project at one of the worlds' most famous newspapers. You can read the entire interview over at the Django site of the Week website.
Django Site of the Week: EveryBlock
The Django Site of the Week is back after a Christmas-induced break with an interview with Adrian Holovaty. Adrian is no stranger to Django, and his name is known throughout the community as one of the brains behind Django's birth and subsequent open-source release. His latest project EveryBlock is the evolution of an earlier mashup, chicagocrime.org, which won Adrian a number of awards. So what are the driving forces behind EveryBlock? I recently spoke with Adrian to find out.
