class documentation

class DebuggedApplication: (source)

View In Hierarchy

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_pin_trust 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_application Run the application and conserve the traceback frames.
Method display_console Display a standalone shell.
Method execute_command Execute a command in a console.
Method get_resource Return a static resource from the shared folder.
Method log_pin_request Log the pin if needed.
Method pin.setter Undocumented
Method pin_auth Authenticates with the pin.
Instance Variable app Undocumented
Instance Variable console_init_func Undocumented
Instance Variable console_path Undocumented
Instance Variable evalex Undocumented
Instance Variable frame_contexts Undocumented
Instance Variable frames Undocumented
Instance Variable pin_logging Undocumented
Instance Variable request_key Undocumented
Instance Variable secret Undocumented
Instance Variable show_hidden_frames Undocumented
Property pin Undocumented
Property pin_cookie_name The name of the pin cookie.
Method _fail_pin_auth Undocumented
Class Variable _pin_cookie Undocumented
Instance Variable _failed_pin_auth Undocumented
Instance Variable _pin Undocumented
def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> t.Iterable[bytes]: (source)

Dispatch the requests.

def __init__(self, app: 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

def check_pin_trust(self, environ: WSGIEnvironment) -> t.Optional[bool]: (source)

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.

def debug_application(self, environ: WSGIEnvironment, start_response: StartResponse) -> t.Iterator[bytes]: (source)

Run the application and conserve the traceback frames.

def display_console(self, request: Request) -> Response: (source)

Display a standalone shell.

def execute_command(self, request: Request, command: str, frame: t.Union[DebugFrameSummary, _ConsoleFrame]) -> Response: (source)

Execute a command in a console.

def get_resource(self, request: Request, filename: str) -> Response: (source)

Return a static resource from the shared folder.

def log_pin_request(self) -> Response: (source)

Log the pin if needed.

@pin.setter
def pin(self, value: str): (source)

Undocumented

def pin_auth(self, request: Request) -> Response: (source)

Authenticates with the pin.

Undocumented

console_init_func = (source)

Undocumented

console_path = (source)

Undocumented

Undocumented

Undocumented

pin_logging = (source)

Undocumented

request_key = (source)

Undocumented

Undocumented

show_hidden_frames = (source)

Undocumented

@property
pin_cookie_name: str = (source)

The name of the pin cookie.

def _fail_pin_auth(self): (source)

Undocumented

_pin_cookie: str = (source)

Undocumented

_failed_pin_auth: int = (source)

Undocumented

Undocumented