'Provides a unique string identifier for the requestor.
This implementation returns the user\'s username.'

def get_identifier(self, request):

    if hasattr(request, u'user'):
        if hasattr(request.user, u'username'):
            return request.user.username
    return u'nouser'
