html = '''

webová aplikace

''' # WSGI-klient def application(environ, start_response): # získání dat z databáze a jejich převod do podoby HTML-tabulky ... # vykreslení vyrobené HTML-tabulky body = bytes(html, encoding='utf-8') response_headers = [ ("Content-type", "text/html; charset=utf-8"), ("Content-length", str(len(body)) ), ] start_response("200 OK", response_headers) return (body,) # WSGI-server (spuštěn pro jednu odpověď) if __name__ == '__main__': from wsgiref.simple_server import make_server server = make_server('localhost', 8080, application) server.serve_forever()