Django

Code

Changeset 7537

Show
Ignore:
Timestamp:
05/16/08 18:24:36 (2 months ago)
Author:
lukeplant
Message:

Added DEBUG_PROPAGATE_EXCEPTIONS setting that helps testing under e.g. twill

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/conf/global_settings.py

    r7401 r7537  
    1212DEBUG = False 
    1313TEMPLATE_DEBUG = False 
     14# True if BaseHandler.get_response() should propagate raw exceptions 
     15# rather than catching them.  This is useful under some testing siutations, 
     16# and should never be used on a live site. 
     17DEBUG_PROPAGATE_EXCEPTIONS = False 
    1418 
    1519# Whether to use the "Etag" header. This saves bandwidth but slows down performance. 
  • django/trunk/django/core/handlers/base.py

    r7168 r7537  
    116116            exc_info = sys.exc_info() 
    117117            receivers = dispatcher.send(signal=signals.got_request_exception, request=request) 
    118             if settings.DEBUG: 
     118 
     119            if settings.DEBUG_PROPAGATE_EXCEPTIONS: 
     120                raise 
     121            elif settings.DEBUG: 
    119122                from django.views import debug 
    120123                return debug.technical_500_response(request, *exc_info) 
  • django/trunk/docs/settings.txt

    r7364 r7537  
    391391the like all give attackers extra information about your server. Never deploy a 
    392392site with ``DEBUG`` turned on. 
     393 
     394DEBUG_PROPAGATE_EXCEPTIONS 
     395-------------------- 
     396 
     397Default: ``False`` 
     398 
     399If set to True, Django's normal exception handling of view functions 
     400will be suppressed, and exceptions will propagate upwards.  This can 
     401be useful for some test setups, and should never be used on a live 
     402site. 
    393403 
    394404DEFAULT_CHARSET