Django 1.7 and Python3 compatibility

This fix compatibility mode for Django1.7 and Python 3.