Home / Function/ __init__() — flask Function Reference

__init__() — flask Function Reference

Architecture documentation for the __init__() function in cli.py from the flask codebase.

Entity Profile

Dependency Diagram

graph TD
  e4e08be1_e9e6_7b53_481b_3e13fc8c8378["__init__()"]
  9fb0ba66_32bf_1412_77b1_174dae79c4b2["ScriptInfo"]
  e4e08be1_e9e6_7b53_481b_3e13fc8c8378 -->|defined in| 9fb0ba66_32bf_1412_77b1_174dae79c4b2
  36bfda2d_4c0b_0fa1_7108_9f786fa1b2bc["get_load_dotenv()"]
  e4e08be1_e9e6_7b53_481b_3e13fc8c8378 -->|calls| 36bfda2d_4c0b_0fa1_7108_9f786fa1b2bc
  style e4e08be1_e9e6_7b53_481b_3e13fc8c8378 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/cli.py lines 305–331

    def __init__(
        self,
        app_import_path: str | None = None,
        create_app: t.Callable[..., Flask] | None = None,
        set_debug_flag: bool = True,
        load_dotenv_defaults: bool = True,
    ) -> None:
        #: Optionally the import path for the Flask application.
        self.app_import_path = app_import_path
        #: Optionally a function that is passed the script info to create
        #: the instance of the application.
        self.create_app = create_app
        #: A dictionary with arbitrary data that can be associated with
        #: this script info.
        self.data: dict[t.Any, t.Any] = {}
        self.set_debug_flag = set_debug_flag

        self.load_dotenv_defaults = get_load_dotenv(load_dotenv_defaults)
        """Whether default ``.flaskenv`` and ``.env`` files should be loaded.

        ``ScriptInfo`` doesn't load anything, this is for reference when doing
        the load elsewhere during processing.

        .. versionadded:: 3.1
        """

        self._loaded_app: Flask | None = None

Subdomains

Defined In

Frequently Asked Questions

What does __init__() do?
__init__() is a function in the flask codebase, defined in src/flask/cli.py.
Where is __init__() defined?
__init__() is defined in src/flask/cli.py at line 305.
What does __init__() call?
__init__() calls 1 function(s): get_load_dotenv.

Analyze Your Own Codebase

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

Try Supermodel Free