Fix for being unable to login with Django 1.6.