
    jg                     P    d dl Z d dlmZ  e j                         Zde_        ddZy)    N)WSGIHandlerc                 \   	 t        |j                  j                  j                  j	                  d      t
              r|t        _        n t        j                  rt        j                  }	 | |       }|j                  |ur|j                  |      |# t        $ r Y 6w xY w# d}d}w xY w)a  
    Alternative function for django.views.debug.technical_500_response.

    Django's convert_exception_to_response() wrapper is called on each 'Middleware' object to avoid
    leaking exceptions. If an uncaught exception is raised, the wrapper calls technical_500_response()
    to create a response for django's debug view.

    Runserver_plus overrides the django debug view's technical_500_response() function to allow for
    an enhanced WSGI debugger view to be displayed. However, because Django calls
    convert_exception_to_response() on each object in the stack of Middleware objects, re-raising an
    error quickly pollutes the traceback displayed.

    Runserver_plus only needs needs traceback frames relevant to WSGIHandler Middleware objects, so
    only store the traceback if it is for a WSGIHandler. If an exception is not raised here, Django
    eventually throws an error for not getting a valid response object for its debug view.
    selfN)
isinstancetb_nexttb_framef_localsgetr   tldwsgi_tbAttributeError__traceback__with_traceback)requestexc_type	exc_valuetbstatus_codes        j/var/www/html/Stanley/venv/lib/python3.12/site-packages/django_extensions/management/technical_response.pynull_technical_500_responser   
   s    "bjj))2266v>LCK[[B 
I""",**2..   	s   A)B ,*B% 	B"!B"%B+)i  )	threadingdjango.core.handlers.wsgir   localr   r   r        r   <module>r      s%     1ioo"r   