@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)
A prefix aware url tag replacement for prelogin URLs
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqwebapp/templatetags/hq_shared_tags.py/prelogin_url