Django 1.5 and py3 compatibilities