def get_script_name(environ):
    "\n    Returns the equivalent of the HTTP request's SCRIPT_NAME environment\n    variable. If Apache mod_rewrite has been used, returns what would have been\n    the script name prior to any rewriting (so it's the script name as seen\n    from the client's perspective), unless the FORCE_SCRIPT_NAME setting is\n    set (to anything).\n    "
    from django.conf import settings
    if (settings.FORCE_SCRIPT_NAME is not None):
        return force_text(settings.FORCE_SCRIPT_NAME)
    script_url = environ.get('SCRIPT_URL', '')
    if (not script_url):
        script_url = environ.get('REDIRECT_URL', '')
    if script_url:
        return force_text(script_url[:(- len(environ.get('PATH_INFO', '')))])
    return force_text(environ.get('SCRIPT_NAME', ''))
Returns the equivalent of the HTTP request's SCRIPT_NAME environment
variable. If Apache mod_rewrite has been used, returns what would have been
the script name prior to any rewriting (so it's the script name as seen
from the client's perspective), unless the FORCE_SCRIPT_NAME setting is
set (to anything).
def get_script_name(environ):
    "\n    Returns the equivalent of the HTTP request's SCRIPT_NAME environment\n    variable. If Apache mod_rewrite has been used, returns what would have been\n    the script name prior to any rewriting (so it's the script name as seen\n    from the client's perspective), unless the FORCE_SCRIPT_NAME setting is\n    set (to anything).\n    "
    from django.conf import settings
    if (settings.FORCE_SCRIPT_NAME is not None):
        return force_text(settings.FORCE_SCRIPT_NAME)
    script_url = environ.get('SCRIPT_URL', )
    if (not script_url):
        script_url = environ.get('REDIRECT_URL', )
    if script_url:
        return force_text(script_url[:(- len(environ.get('PATH_INFO', )))])
    return force_text(environ.get('SCRIPT_NAME', ))