class DebuggedApplication: (source)
Enables debugging support for a given application:: from werkzeug.debug import DebuggedApplication from myapp import app app = DebuggedApplication(app, evalex=True) The ``evalex`` argument allows evaluating expressions in any frame of a traceback. This works by preserving each frame with its local state. Some state, such as :doc:`local`, cannot be restored with the frame by default. When ``evalex`` is enabled, ``environ["werkzeug.debug.preserve_context"]`` will be a callable that takes a context manager, and can be called multiple times. Each context manager will be entered before evaluating code in the frame, then exited again, so they can perform setup and cleanup for each call. :param app: the WSGI application to run debugged. :param evalex: enable exception evaluation feature (interactive debugging). This requires a non-forking server. :param request_key: The key that points to the request object in this environment. This parameter is ignored in current versions. :param console_path: the URL for a general purpose console. :param console_init_func: the function that is executed before starting the general purpose console. The return value is used as initial namespace. :param show_hidden_frames: by default hidden traceback frames are skipped. You can show them by setting this parameter to `True`. :param pin_security: can be used to disable the pin based security system. :param pin_logging: enables the logging of the pin system. .. versionchanged:: 2.2 Added the ``werkzeug.debug.preserve_context`` environ key.
Method | __call__ |
Dispatch the requests. |
Method | __init__ |
Undocumented |
Method | check |
Checks if the request passed the pin test. This returns `True` if the request is trusted on a pin/cookie basis and returns `False` if not. Additionally if the cookie's stored pin hash is wrong it will return `None` so that appropriate action can be taken. |
Method | debug |
Run the application and conserve the traceback frames. |
Method | display |
Display a standalone shell. |
Method | execute |
Execute a command in a console. |
Method | get |
Return a static resource from the shared folder. |
Method | log |
Log the pin if needed. |
Method | pin |
Undocumented |
Method | pin |
Authenticates with the pin. |
Instance Variable | app |
Undocumented |
Instance Variable | console |
Undocumented |
Instance Variable | console |
Undocumented |
Instance Variable | evalex |
Undocumented |
Instance Variable | frame |
Undocumented |
Instance Variable | frames |
Undocumented |
Instance Variable | pin |
Undocumented |
Instance Variable | request |
Undocumented |
Instance Variable | secret |
Undocumented |
Instance Variable | show |
Undocumented |
Property | pin |
Undocumented |
Property | pin |
The name of the pin cookie. |
Method | _fail |
Undocumented |
Class Variable | _pin |
Undocumented |
Instance Variable | _failed |
Undocumented |
Instance Variable | _pin |
Undocumented |
WSGIEnvironment
, start_response: StartResponse
) -> t.Iterable[ bytes]
:
(source)
¶
Dispatch the requests.
WSGIApplication
, evalex: bool
= False, request_key: str
= 'werkzeug.request', console_path: str
= '/console', console_init_func: t.Optional[ t.Callable[ [], t.Dict[ str, t.Any]]]
= None, show_hidden_frames: bool
= False, pin_security: bool
= True, pin_logging: bool
= True):
(source)
¶
Undocumented
Checks if the request passed the pin test. This returns `True` if the request is trusted on a pin/cookie basis and returns `False` if not. Additionally if the cookie's stored pin hash is wrong it will return `None` so that appropriate action can be taken.
WSGIEnvironment
, start_response: StartResponse
) -> t.Iterator[ bytes]
:
(source)
¶
Run the application and conserve the traceback frames.
Request
, command: str
, frame: t.Union[ DebugFrameSummary, _ConsoleFrame]
) -> Response
:
(source)
¶
Execute a command in a console.