Revert "Revert "django 1.5 compatibility fix""

This reverts commit 4d9a1a69f68cedd3328400456882957481583105.