Python 3 compatibility

As per [the documentation](https://docs.djangoproject.com/en/dev/topics/python3/#writing-compatible-code-with-six), this change allows compatibility with Python 3.

This requires Django 1.4.2 or higher.