Home / File/ wrappers.py — flask Source File

wrappers.py — flask Source File

Architecture documentation for wrappers.py, a python file in the flask codebase. 10 imports, 8 dependents.

File python ApplicationCore Scaffolding 10 imports 8 dependents 1 functions 2 classes

Entity Profile

Dependency Diagram

graph LR
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb["wrappers.py"]
  949a3336_caad_34e4_9d3f_a6e1653188ba["949a3336:caad:34e4:9d3f:a6e1653188ba"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> 949a3336_caad_34e4_9d3f_a6e1653188ba
  9cff5a62_7dbb_7b80_cf3c_128a7a2fda28["globals.py"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> 9cff5a62_7dbb_7b80_cf3c_128a7a2fda28
  881f9803_28d6_7d77_c8d7_1098b41ccf84["helpers.py"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> 881f9803_28d6_7d77_c8d7_1098b41ccf84
  2424d287_48d8_ffa1_d242_225e3c3031a8["_split_blueprint_path"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> 2424d287_48d8_ffa1_d242_225e3c3031a8
  7fa0faba_d854_797c_b6bd_20820e905793["debughelpers.py"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> 7fa0faba_d854_797c_b6bd_20820e905793
  6a550efd_c111_6300_d6cd_0d4f9678b80f["attach_enctype_error_multidict"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> 6a550efd_c111_6300_d6cd_0d4f9678b80f
  d3e9218c_bf0a_48f5_15c9_90795af6f3ac["typing.py"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> d3e9218c_bf0a_48f5_15c9_90795af6f3ac
  9b468bc7_cc0b_fef2_ed71_07b4f027fb55["werkzeug.exceptions"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> 9b468bc7_cc0b_fef2_ed71_07b4f027fb55
  22ed428d_d5d1_64b4_e96c_29b42f8212ff["werkzeug.wrappers"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> 22ed428d_d5d1_64b4_e96c_29b42f8212ff
  e2a72d84_5c89_bb0d_3a69_5d24eacd9d7c["werkzeug.routing"]
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb --> e2a72d84_5c89_bb0d_3a69_5d24eacd9d7c
  e1ae29a1_73d3_d5e9_3fd5_548f4ac50138["__init__.py"]
  e1ae29a1_73d3_d5e9_3fd5_548f4ac50138 --> fb9bd0c5_9d0a_c235_58cf_8d691dde64fb
  9612cfdd_2178_92c0_2ed7_16ebb0c72901["app.py"]
  9612cfdd_2178_92c0_2ed7_16ebb0c72901 --> fb9bd0c5_9d0a_c235_58cf_8d691dde64fb
  ebbad164_1651_bd83_3f3b_106e2ce78240["blueprints.py"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> fb9bd0c5_9d0a_c235_58cf_8d691dde64fb
  49f8280b_d7dc_110c_b848_8e7e56bfb19b["ctx.py"]
  49f8280b_d7dc_110c_b848_8e7e56bfb19b --> fb9bd0c5_9d0a_c235_58cf_8d691dde64fb
  style fb9bd0c5_9d0a_c235_58cf_8d691dde64fb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from __future__ import annotations

import typing as t

from werkzeug.exceptions import BadRequest
from werkzeug.exceptions import HTTPException
from werkzeug.wrappers import Request as RequestBase
from werkzeug.wrappers import Response as ResponseBase

from . import json
from .globals import current_app
from .helpers import _split_blueprint_path

if t.TYPE_CHECKING:  # pragma: no cover
    from werkzeug.routing import Rule


class Request(RequestBase):
    """The request object used by default in Flask.  Remembers the
    matched endpoint and view arguments.

    It is what ends up as :class:`~flask.request`.  If you want to replace
    the request object used you can subclass this and set
    :attr:`~flask.Flask.request_class` to your subclass.

    The request object is a :class:`~werkzeug.wrappers.Request` subclass and
    provides all of the attributes Werkzeug defines plus a few Flask
    specific ones.
    """

    json_module: t.Any = json

    #: The internal URL rule that matched the request.  This can be
    #: useful to inspect which methods are allowed for the URL from
    #: a before/after handler (``request.url_rule.methods``) etc.
    #: Though if the request's method was invalid for the URL rule,
    #: the valid list is available in ``routing_exception.valid_methods``
    #: instead (an attribute of the Werkzeug exception
    #: :exc:`~werkzeug.exceptions.MethodNotAllowed`)
    #: because the request was never internally bound.
    #:
    #: .. versionadded:: 0.6
    url_rule: Rule | None = None

    #: A dict of view arguments that matched the request.  If an exception
    #: happened when matching, this will be ``None``.
    view_args: dict[str, t.Any] | None = None

    #: If matching the URL failed, this is the exception that will be
    #: raised / was raised as part of the request handling.  This is
    #: usually a :exc:`~werkzeug.exceptions.NotFound` exception or
    #: something similar.
    routing_exception: HTTPException | None = None

    _max_content_length: int | None = None
    _max_form_memory_size: int | None = None
    _max_form_parts: int | None = None

    @property
    def max_content_length(self) -> int | None:
// ... (198 more lines)

Subdomains

Functions

Classes

Dependencies

Frequently Asked Questions

What does wrappers.py do?
wrappers.py is a source file in the flask codebase, written in python. It belongs to the ApplicationCore domain, Scaffolding subdomain.
What functions are defined in wrappers.py?
wrappers.py defines 1 function(s): werkzeug.
What does wrappers.py depend on?
wrappers.py imports 10 module(s): 949a3336:caad:34e4:9d3f:a6e1653188ba, _split_blueprint_path, attach_enctype_error_multidict, debughelpers.py, globals.py, helpers.py, typing.py, werkzeug.exceptions, and 2 more.
What files import wrappers.py?
wrappers.py is imported by 8 file(s): __init__.py, app.py, blueprints.py, ctx.py, debughelpers.py, globals.py, helpers.py, sessions.py.
Where is wrappers.py in the architecture?
wrappers.py is located at src/flask/wrappers.py (domain: ApplicationCore, subdomain: Scaffolding, directory: src/flask).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free