@register.filter()<EOL>def site_prefixed(path):
if path is None:<EOL><INDENT>path = '<STR_LIT>'<EOL><DEDENT>path_prefix = '<STR_LIT>'<EOL>if settings.DEBUG and hasattr(settings, '<STR_LIT>'):<EOL><INDENT>candidate = '<STR_LIT>' % settings.APP_NAME<EOL>if not path.startswith(candidate):<EOL><INDENT>path_prefix = candidate<EOL><DEDENT><DEDENT>if path:<EOL><INDENT>path_prefix += '<STR_LIT:/>'<EOL>if path.startswith('<STR_LIT:/>'):<EOL><INDENT>path = path[<NUM_LIT:1>:]<EOL><DEDENT><DEDENT>return urljoin(path_prefix, path)<EOL>
*Mockup*: adds the path prefix when required.