Changeset 1415 for trunk/pylucid/tests/server_tests/fastCGI_test.fcgi
- Timestamp:
- 02/15/08 17:08:59 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/pylucid/tests/server_tests/fastCGI_test.fcgi
r1413 r1415 19 19 """ 20 20 21 import sys, os 21 import sys, os, time 22 22 23 23 # Logging 24 24 #LOGFILE = None # No logging! 25 LOGFILE = "PyLucid_fcgi .log" # Log into this file25 LOGFILE = "PyLucid_fcgi_test.log" # Log into this file 26 26 27 27 … … 51 51 52 52 53 start_overall = time.time() 54 53 55 try: 54 56 def app(environ, start_response): 55 57 start_response('200 OK', [('Content-Type', 'text/html')]) 58 yield '<h1>FastCGI test app</h1>' 59 60 # Display the overall running time 61 yield 'overall time: %.2fsec' % (time.time() - start_overall) 56 62 57 63 from cgi import escape 58 yield '<h1>FastCGI Environment</h1><table>' 59 yield '<tr><th>%s</th><td>%s</td></tr>' % ( 60 escape(repr(k)), escape(repr(v)) 61 ) 64 yield '<h2>FastCGI Environment:</h2><table>' 65 for k, v in sorted(environ.items()): 66 yield '<tr><th>%s</th><td>%s</td></tr>' % ( 67 escape(repr(k)), escape(repr(v)) 68 ) 69 yield '</table>' 70 62 71 63 72 WSGIServer(app).run()