Skip to content

Wrong default value for FLASK_ENV #4740

Closed
@studer-l

Description

@studer-l

Previously, if FLASK_ENV was not set, it would default to "production", now it defaults to "development".

Reproduction:

from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello_world():
    print(f"{app.config.get('ENV')=}")
    return "<p>Hello, World!</p>"

Run using gunicorn, gunicorn flask_demo.app:app with FLASK_ENV unset,

Flask 2.2.1, this handler prints:
app.config.get('ENV')='development'

downgrade to 2.1.0:
app.config.get('ENV')='production'

I assume this due to #4720, src/flask/app.py:693

Environment:

  • Python version: 3.10.4
  • Flask version: 2.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions