def get_identifier(self, request):
        if hasattr(request, 'user'):
            if hasattr(request.user, 'username'):
                return request.user.username

        return 'nouser'
Provides a unique string identifier for the requestor.
dataset/ETHPy150Open django-tastypie/django-tastypie/tastypie/authentication.py/DigestAuthentication.get_identifier