'Checks a user\'s basic auth credentials against the current
Django auth backend.
Should return either ``True`` if allowed, ``False`` if not or an
``HttpResponse`` if you need something custom.'

def is_authenticated(self, request, **kwargs):

    try:
        (username, password) = self.extract_credentials(request)
    except ValueError:
        return self._unauthorized()
    if ((not username) or (not password)):
        return self._unauthorized()
    if self.backend:
        user = self.backend.authenticate(username=username, password=password)
    else:
        if ((not self.require_active) and (u'django.contrib.auth.backends.ModelBackend' in settings.AUTHENTICATION_BACKENDS)):
            warnings.warn(u'Authenticating    inactive    users    via    ModelUserBackend    not    supported    for    Django    >=    1.10')
        user = authenticate(username=username, password=password)
    if (user is None):
        return self._unauthorized()
    if (not self.check_active(user)):
        return False
    request.user = user
    return True
