Home / File/ blueprints.py — flask Source File

blueprints.py — flask Source File

Architecture documentation for blueprints.py, a python file in the flask codebase. 12 imports, 2 dependents.

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

Entity Profile

Dependency Diagram

graph LR
  ebbad164_1651_bd83_3f3b_106e2ce78240["blueprints.py"]
  a96499c3_f8a9_e782_f156_1c1ee4a86c69["cli.py"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> a96499c3_f8a9_e782_f156_1c1ee4a86c69
  ea63e19e_2fd3_885d_2922_e4101fe8320a["AppGroup"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> ea63e19e_2fd3_885d_2922_e4101fe8320a
  9cff5a62_7dbb_7b80_cf3c_128a7a2fda28["globals.py"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> 9cff5a62_7dbb_7b80_cf3c_128a7a2fda28
  881f9803_28d6_7d77_c8d7_1098b41ccf84["helpers.py"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> 881f9803_28d6_7d77_c8d7_1098b41ccf84
  cd968d21_9286_02d4_74b3_ae5e22f8a986["send_from_directory"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> cd968d21_9286_02d4_74b3_ae5e22f8a986
  5263916a_5224_b049_f6f1_d6e67aeef285["sansio.blueprints"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> 5263916a_5224_b049_f6f1_d6e67aeef285
  c7e51d1e_44dd_175c_9e8a_ba5d5dbfdec4["sansio.scaffold"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> c7e51d1e_44dd_175c_9e8a_ba5d5dbfdec4
  fb9bd0c5_9d0a_c235_58cf_8d691dde64fb["wrappers.py"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> fb9bd0c5_9d0a_c235_58cf_8d691dde64fb
  d37e98da_a97c_3126_ebd5_0a54e0ea9b29["Response"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> d37e98da_a97c_3126_ebd5_0a54e0ea9b29
  bdc6911d_da67_3a1f_90cb_90f5e9f0603e["os"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> bdc6911d_da67_3a1f_90cb_90f5e9f0603e
  d3e9218c_bf0a_48f5_15c9_90795af6f3ac["typing.py"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> d3e9218c_bf0a_48f5_15c9_90795af6f3ac
  bdb4799f_8b0c_fcfd_51cc_f0b833652f8f["datetime"]
  ebbad164_1651_bd83_3f3b_106e2ce78240 --> bdb4799f_8b0c_fcfd_51cc_f0b833652f8f
  e1ae29a1_73d3_d5e9_3fd5_548f4ac50138["__init__.py"]
  e1ae29a1_73d3_d5e9_3fd5_548f4ac50138 --> ebbad164_1651_bd83_3f3b_106e2ce78240
  7fa0faba_d854_797c_b6bd_20820e905793["debughelpers.py"]
  7fa0faba_d854_797c_b6bd_20820e905793 --> ebbad164_1651_bd83_3f3b_106e2ce78240
  style ebbad164_1651_bd83_3f3b_106e2ce78240 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

from __future__ import annotations

import os
import typing as t
from datetime import timedelta

from .cli import AppGroup
from .globals import current_app
from .helpers import send_from_directory
from .sansio.blueprints import Blueprint as SansioBlueprint
from .sansio.blueprints import BlueprintSetupState as BlueprintSetupState  # noqa
from .sansio.scaffold import _sentinel

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


class Blueprint(SansioBlueprint):
    def __init__(
        self,
        name: str,
        import_name: str,
        static_folder: str | os.PathLike[str] | None = None,
        static_url_path: str | None = None,
        template_folder: str | os.PathLike[str] | None = None,
        url_prefix: str | None = None,
        subdomain: str | None = None,
        url_defaults: dict[str, t.Any] | None = None,
        root_path: str | None = None,
        cli_group: str | None = _sentinel,  # type: ignore
    ) -> None:
        super().__init__(
            name,
            import_name,
            static_folder,
            static_url_path,
            template_folder,
            url_prefix,
            subdomain,
            url_defaults,
            root_path,
            cli_group,
        )

        #: The Click command group for registering CLI commands for this
        #: object. The commands are available from the ``flask`` command
        #: once the application has been discovered and blueprints have
        #: been registered.
        self.cli = AppGroup()

        # Set the name of the Click group in case someone wants to add
        # the app's commands to another CLI tool.
        self.cli.name = self.name

    def get_send_file_max_age(self, filename: str | None) -> int | None:
        """Used by :func:`send_file` to determine the ``max_age`` cache
        value for a given file path if it wasn't passed.

        By default, this returns :data:`SEND_FILE_MAX_AGE_DEFAULT` from
        the configuration of :data:`~flask.current_app`. This defaults
// ... (69 more lines)

Subdomains

Functions

Classes

Dependencies

Frequently Asked Questions

What does blueprints.py do?
blueprints.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 blueprints.py?
blueprints.py defines 1 function(s): wrappers.
What does blueprints.py depend on?
blueprints.py imports 12 module(s): AppGroup, Response, cli.py, datetime, globals.py, helpers.py, os, sansio.blueprints, and 4 more.
What files import blueprints.py?
blueprints.py is imported by 2 file(s): __init__.py, debughelpers.py.
Where is blueprints.py in the architecture?
blueprints.py is located at src/flask/blueprints.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