BTW, that snippet is from 2010.. so it may be using outdated Django components.