With the authenticate() and get_user() working, I made the according changes in the basic authentication checks, mainly adding if user is not None: \ if user.is_active \ login(request, user).