def pyips(environ, start_response): query_values = cgi.parse_qsl(environ["QUERY_STRING"]) image_str, content_type = pyipsmodule.process_request(query_values) start_response("200 OK", [("Content-Type", content_type)]) return [image_str]
def process(req): # return str(req), str(dir(req)), req.parsed_uri query_values = cgi.parse_qsl(req.parsed_uri[7]) # environ['QUERY_STRING']) image_str, content_type = pyipsmodule.process_request(query_values) # start_response('200 OK', [('Content-Type', content_type)]) req.content_type = content_type return image_str