def auth(username, password):
    import django.contrib.auth  # pylint: disable=import-error

    django_auth_setup()
    user = django.contrib.auth.authenticate(username=username, password=password)
    if user is not None:
        if user.is_active:
            log.debug('Django authentication successful')

            auth_dict_from_db = retrieve_auth_entries(username)[username]
            if auth_dict_from_db is not None:
                __opts__['external_auth']['django'][username] = auth_dict_from_db

            return True
        else:
            log.debug('Django authentication: the password is valid but the account is disabled.')

    return False
calculate pg count for pools
dataset/ETHPy150Open saltstack/salt/salt/auth/django.py/auth--crossover with--dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/utils/ceph.py/get_pool_pg_count