wsgi のブラウザで cgitb デバッグをオンにするにはどうすればよいですか?
# enable debugging
import cgitb
cgitb.enable()
def application(environ, start_response):
# build the response body possibly using the environ dictionary
response_body = 'The request method was %s' % environ['REQUEST_METHOD']
status = '200 OK'
response_headerx = [('Content-Type', 'text/plain'),
('Content-Length', str(len(response_body)))]
# Send them to the server using the supplied function
start_response(status, response_headers)
return [response_body]
エラーは Apache ログの error.log でのみ見つかります。
NameError: グローバル名 'response_headers' が定義されていません。リファラー: http://127.0.0.1/python-
ブラウザ上でこれを取得し、
サーバーエラー!
サーバーで内部エラーが発生し、リクエストを完了できませんでした。サーバーが過負荷になっているか、CGI スクリプトにエラーがありました。
これがサーバー エラーであると思われる場合は、ウェブマスターに連絡してください。
エラー 500
127.0.0.1 Apache/2.4.7 (Win32) mod_wsgi/4.4.12 Python/2.7.10 PHP/5.6.4
何か案は?