def request_uri(environ, include_query=1):
 url = application_uri(environ)
 from urllib import quote
 path_info = quote(environ.get('PATH_INFO', ''))
 if (not environ.get('SCRIPT_NAME')):
  url += path_info[1:]
 else:
  url += path_info
 if (include_query and environ.get('QUERY_STRING')):
  url += ('?' + environ['QUERY_STRING'])
 return url

def request_uri ( environ , include_query = 1 ) : url = application_uri ( environ ) from urllib import quote path_info = quote ( environ . get ( 'PATH_INFO' , '' ) ) if ( not environ . get ( 'SCRIPT_NAME' ) ) : url += path_info [ 1 : ] else : url += path_info if ( include_query and environ . get ( 'QUERY_STRING' ) ) : url += ( '?' + environ [ 'QUERY_STRING' ] ) return url
return the full request uri .