Make compatable with Python3 and Django 1.7