Home / File/ app.py — flask Source File

app.py — flask Source File

Architecture documentation for app.py, a python file in the flask codebase. 26 imports, 1 dependents.

File python ApplicationCore Scaffolding 26 imports 1 dependents 2 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  ed6b5ded_713e_74a7_fd38_486c9303d21c["app.py"]
  ef067598_b87b_459b_7a19_f6c8df8fd2e4["ef067598:b87b:459b:7a19:f6c8df8fd2e4"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> ef067598_b87b_459b_7a19_f6c8df8fd2e4
  01bb8e80_e553_6656_cefc_b65f617f381c["config"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> 01bb8e80_e553_6656_cefc_b65f617f381c
  543e04c6_0fdf_b35c_189c_f45076bc4860["ctx"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> 543e04c6_0fdf_b35c_189c_f45076bc4860
  26e52470_30b2_ff5b_1d4a_69e4e1a5d06c["helpers"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> 26e52470_30b2_ff5b_1d4a_69e4e1a5d06c
  e3c1c8e3_a8f9_3671_4b9c_8312bd3e0b66["json.provider"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> e3c1c8e3_a8f9_3671_4b9c_8312bd3e0b66
  bc03062a_d2ef_ae9e_e342_23608cb51cea["logging"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> bc03062a_d2ef_ae9e_e342_23608cb51cea
  55e8b855_d95d_ace3_7d8e_5938af2604c3["templating"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> 55e8b855_d95d_ace3_7d8e_5938af2604c3
  b48dce3f_427c_079b_4c4a_8f5873f5b51f["scaffold.py"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> b48dce3f_427c_079b_4c4a_8f5873f5b51f
  dd1e88a5_022f_b7a5_beb9_d356fce722be["_endpoint_from_view_func"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> dd1e88a5_022f_b7a5_beb9_d356fce722be
  4edb5aa7_d577_d1ba_2a86_d1b146357835["find_package"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> 4edb5aa7_d577_d1ba_2a86_d1b146357835
  a813bd5c_bf41_d926_8dde_6a113d5e0018["Scaffold"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> a813bd5c_bf41_d926_8dde_6a113d5e0018
  82a2ebca_28b9_36f9_fc57_965b07665f6d["setupmethod"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> 82a2ebca_28b9_36f9_fc57_965b07665f6d
  4c377261_a58d_1793_809f_d72f55ab2257["testing"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> 4c377261_a58d_1793_809f_d72f55ab2257
  758a865d_0775_4c38_5582_499379448d06["blueprints.py"]
  ed6b5ded_713e_74a7_fd38_486c9303d21c --> 758a865d_0775_4c38_5582_499379448d06
  style ed6b5ded_713e_74a7_fd38_486c9303d21c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from __future__ import annotations

import logging
import os
import sys
import typing as t
from datetime import timedelta
from itertools import chain

from werkzeug.exceptions import Aborter
from werkzeug.exceptions import BadRequest
from werkzeug.exceptions import BadRequestKeyError
from werkzeug.routing import BuildError
from werkzeug.routing import Map
from werkzeug.routing import Rule
from werkzeug.sansio.response import Response
from werkzeug.utils import cached_property
from werkzeug.utils import redirect as _wz_redirect

from .. import typing as ft
from ..config import Config
from ..config import ConfigAttribute
from ..ctx import _AppCtxGlobals
from ..helpers import _split_blueprint_path
from ..helpers import get_debug_flag
from ..json.provider import DefaultJSONProvider
from ..json.provider import JSONProvider
from ..logging import create_logger
from ..templating import DispatchingJinjaLoader
from ..templating import Environment
from .scaffold import _endpoint_from_view_func
from .scaffold import find_package
from .scaffold import Scaffold
from .scaffold import setupmethod

if t.TYPE_CHECKING:  # pragma: no cover
    from werkzeug.wrappers import Response as BaseResponse

    from ..testing import FlaskClient
    from ..testing import FlaskCliRunner
    from .blueprints import Blueprint

T_shell_context_processor = t.TypeVar(
    "T_shell_context_processor", bound=ft.ShellContextProcessorCallable
)
T_teardown = t.TypeVar("T_teardown", bound=ft.TeardownCallable)
T_template_filter = t.TypeVar("T_template_filter", bound=ft.TemplateFilterCallable)
T_template_global = t.TypeVar("T_template_global", bound=ft.TemplateGlobalCallable)
T_template_test = t.TypeVar("T_template_test", bound=ft.TemplateTestCallable)


def _make_timedelta(value: timedelta | int | None) -> timedelta | None:
    if value is None or isinstance(value, timedelta):
        return value

    return timedelta(seconds=value)


class App(Scaffold):
    """The flask object implements a WSGI application and acts as the central
// ... (951 more lines)

Subdomains

Classes

Dependencies

Frequently Asked Questions

What does app.py do?
app.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 app.py?
app.py defines 2 function(s): _make_timedelta, werkzeug.
What does app.py depend on?
app.py imports 26 module(s): Blueprint, Scaffold, _endpoint_from_view_func, blueprints.py, config, ctx, datetime, ef067598:b87b:459b:7a19:f6c8df8fd2e4, and 18 more.
What files import app.py?
app.py is imported by 1 file(s): blueprints.py.
Where is app.py in the architecture?
app.py is located at src/flask/sansio/app.py (domain: ApplicationCore, subdomain: Scaffolding, directory: src/flask/sansio).

Analyze Your Own Codebase

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

Try Supermodel Free