Django1.6 compatibility
Merge pull request #760 from magopian/master

compatibility with Django1.6