Code from Linux Format magazine tutorial for Django