class HelloWorld(BaseApplication): def __init__(self, environ, start_response): super(HelloWorld, self).__init__(environ, start_response) self.request = Request(environ) def process_request(self): self.request.send_response('Hello World')
class DynamicResponse(BaseApplication): def __init__(self, environ, start_response): super(DynamicResponse, self).__init__(environ, start_response) self.request = Request(environ) def process_request(self): def countdown(): yield '<h1>Dynamic Response</h1>' for i in xrange(500, 0, -1): yield ' %d ' % i sleep(0.01) self.request.send_response(countdown())
def __init__(self, environ, start_response): super(HelloWorld, self).__init__(environ, start_response) self.request = Request(environ)
def __init__(self, environ, start_response): super(DynamicResponse, self).__init__(environ, start_response) self.request = Request(environ)