@register.simple_tag(takes_context=True)
def prelogin_url(context, urlname):
    if context.get('url_uses_prefix', False) and context.get('LANGUAGE_CODE', False):
        return reverse(urlname, args=[context['LANGUAGE_CODE']])
    else:
        return reverse(urlname)
Try to determine the current system user's username to use as a default.
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqwebapp/templatetags/hq_shared_tags.py/prelogin_url--crossover with--dataset/ETHPy150Open django/django/django/contrib/auth/management/__init__.py/get_default_username