Add django < 1.7 compatibility (introduced in previous commits)