settings.AUTH_USER_MODEL
is a string. It is not a model object.
You need to do something like this:
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
Now,
queryset = User.objects.all()
-- OR --
if you are using only django 1.5, you can simply do:
from django.contrib.auth import get_user_model
queryset = get_user_model().objects.all()