Backported so it would work in at least django 1.3
Added setup