This version has been modified to offer the option of using django-allauth as the authentication backend.