From a6a7a57380cd8f7410753c3b819ba6d09198d8c9 Mon Sep 17 00:00:00 2001 From: David Lord Date: Thu, 4 Aug 2022 07:24:20 -0700 Subject: [PATCH] fix default value of app.env --- CHANGES.rst | 3 +++ src/flask/app.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 547c121f5d..efc373b835 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,9 @@ Version 2.2.2 Unreleased +- Fix the default value for ``app.env`` to be ``"production"``. This + attribute remains deprecated. :issue:`4740` + Version 2.2.1 ------------- diff --git a/src/flask/app.py b/src/flask/app.py index 965865f2aa..db442c9edf 100644 --- a/src/flask/app.py +++ b/src/flask/app.py @@ -827,7 +827,7 @@ def make_config(self, instance_relative: bool = False) -> Config: if instance_relative: root_path = self.instance_path defaults = dict(self.default_config) - defaults["ENV"] = os.environ.get("FLASK_ENV") or "development" + defaults["ENV"] = os.environ.get("FLASK_ENV") or "production" defaults["DEBUG"] = get_debug_flag() return self.config_class(root_path, defaults)