Home / Function/ _set_debug() — flask Function Reference

_set_debug() — flask Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  635e8d27_287a_c00b_b275_9a846f9b968b["_set_debug()"]
  a96499c3_f8a9_e782_f156_1c1ee4a86c69["cli.py"]
  635e8d27_287a_c00b_b275_9a846f9b968b -->|defined in| a96499c3_f8a9_e782_f156_1c1ee4a86c69
  style 635e8d27_287a_c00b_b275_9a846f9b968b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/flask/cli.py lines 468–482

def _set_debug(ctx: click.Context, param: click.Option, value: bool) -> bool | None:
    # If the flag isn't provided, it will default to False. Don't use
    # that, let debug be set by env in that case.
    source = ctx.get_parameter_source(param.name)  # type: ignore[arg-type]

    if source is not None and source in (
        ParameterSource.DEFAULT,
        ParameterSource.DEFAULT_MAP,
    ):
        return None

    # Set with env var instead of ScriptInfo.load so that it can be
    # accessed early during a factory function.
    os.environ["FLASK_DEBUG"] = "1" if value else "0"
    return value

Subdomains

Defined In

Frequently Asked Questions

What does _set_debug() do?
_set_debug() is a function in the flask codebase, defined in src/flask/cli.py.
Where is _set_debug() defined?
_set_debug() is defined in src/flask/cli.py at line 468.

Analyze Your Own Codebase

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

Try Supermodel Free