def get_default_username(check_db=True):
    from django.contrib.auth.management.commands.createsuperuser import (
        RE_VALID_USERNAME)
    default_username = get_system_username()
    try:
        default_username = unicodedata.normalize('NFKD', default_username)\
            .encode('ascii', 'ignore').replace(' ', '').lower()
    except UnicodeDecodeError:
        return ''
    if not RE_VALID_USERNAME.match(default_username):
        return ''
    # Don't return the default username if it is already taken.
    if check_db and default_username:
        try:
            User.objects.get(username=default_username)
        except User.DoesNotExist:
            pass
        else:
            return ''
    return default_username
Try to determine the current system user's username to use as a default.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.4/django/contrib/auth/management/__init__.py/get_default_username