get_debug_flag (helpers.py)

flask · src/flask/helpers.py · python · BSD-3-Clause
database, dev-tools, tag:debug-mode, tag:config-flag, tag:runtime-mode, tag:env-detection

Returns app debug flag from config/env for Flask runtime mode.

# Source: https://github.com/pallets/flask | License: BSD-3-Clause | Copyright 2010 Pallets
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations

import importlib.util
import os
import sys
import typing as t
from datetime import datetime
from functools import cache
from functools import update_wrapper
from types import TracebackType

import werkzeug.utils
from werkzeug.exceptions import abort as _wz_abort
from werkzeug.utils import redirect as _wz_redirect
from werkzeug.wrappers import Response as BaseResponse

from .globals import _cv_app
from .globals import app_ctx
from .globals import current_app
from .globals import request
from .globals import session
from .signals import message_flashed

if t.TYPE_CHECKING:  # pragma: no cover
    from .

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key