Ajax login view fix for Python 3