Browse Source

DEBUG option in config.py now toggles debugger in fcgi.py and

werkzeug.
staff_tasks_refactor
Nathan Wilson 8 years ago
parent
commit
e20e69aee4
2 changed files with 10 additions and 4 deletions
  1. +9
    -3
      fcgi.py
  2. +1
    -1
      wakarimasen.py

+ 9
- 3
fcgi.py View File

@@ -46,6 +46,8 @@ non-FastCGI context. If you want to force CGI behavior, set the environment
variable FCGI_FORCE_CGI to "Y" or "y".
"""

import config, config_defaults

__author__ = 'Allan Saddi <allan@saddi.com>'
__version__ = '$Revision$'

@@ -1138,9 +1140,13 @@ class Server(object):
Called by Request if an exception occurs within the handler. May and
should be overridden.
"""
import cgitb
req.stdout.write('Content-Type: text/html\r\n\r\n' +
cgitb.html(sys.exc_info()))
if config.DEBUG:
import cgitb
req.stdout.write('Content-Type: text/html\r\n\r\n' +
cgitb.html(sys.exc_info()))
else:
req.stdout.write('Content-Type: text/html\r\n\r\n' +
'Internal server error.')

class WSGIServer(Server):
"""


+ 1
- 1
wakarimasen.py View File

@@ -74,7 +74,7 @@ def main():
util.wrap_static(application, __file__,
index='wakaba.html',
not_found_handler=app.not_found),
use_reloader=True)
use_reloader=True, use_debugger=config.DEBUG)

if __name__ == '__main__':
main()

Loading…
Cancel
Save