So sieht meine App aus:
Code: Alles auswählen
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#~ import cgitb;cgitb.enable()
import time
class HelloWorldApplication(object):
def __init__(self, environ, start_response):
self.environ = environ
self.start_response = start_response
def __iter__(self):
self.start_response('200 OK', [('Content-Type', 'text/plain')])
yield time.time()
yield 'Hallo Welt <br>'
yield 'Hallo Welt2'
app = HelloWorldApplication
if __name__ == '__main__':
from james import WSGIServer
server = WSGIServer(
applications={'/': app},
autoreload = True,
)
server.run()