Fix crash on Python 3.x and Django >= 1.5
Merge pull request #392 from lig/patch-1

Fix crash on Python 3.x and Django >= 1.5