parameters: (environ)
return_statement: return url
docstring: Return the application's base URI (no PATH_INFO or QUERY_STRING)
docstring_summary: Return the application's base URI (no PATH_INFO or QUERY_STRING)
docstring_tokens: Return the application s base URI ( no PATH_INFO or QUERY_STRING )
function: def application_uri(environ):
      """Return the application's base URI (no PATH_INFO or QUERY_STRING)"""
      url = environ['wsgi.url_scheme']+'://'
      from urllib import quote
  
      if environ.get('HTTP_HOST'):
          url += environ['HTTP_HOST']
      else:
          url += environ['SERVER_NAME']
  
          if environ['wsgi.url_scheme'] == 'https':
              if environ['SERVER_PORT'] != '443':
                  url += ':' + environ['SERVER_PORT']
          else:
              if environ['SERVER_PORT'] != '80':
                  url += ':' + environ['SERVER_PORT']
  
      url += quote(environ.get('SCRIPT_NAME') or '/')
      return url
function_tokens: def application_uri ( environ ) : url = environ [ 'wsgi.url_scheme' ] + '://' from urllib import quote if environ . get ( 'HTTP_HOST' ) : url += environ [ 'HTTP_HOST' ] else : url += environ [ 'SERVER_NAME' ] if environ [ 'wsgi.url_scheme' ] == 'https' : if environ [ 'SERVER_PORT' ] != '443' : url += ':' + environ [ 'SERVER_PORT' ] else : if environ [ 'SERVER_PORT' ] != '80' : url += ':' + environ [ 'SERVER_PORT' ] url += quote ( environ . get ( 'SCRIPT_NAME' ) or '/' ) return url