-
-
Notifications
You must be signed in to change notification settings - Fork 16.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deprecate FLASK_ENV
#4714
Comments
I must be missing something.
yields
|
|
Seems like setting the DEBUG config key no longer works after this change.
results in:
|
Read the docs about the debug config. That is not related to this change. |
Man, my bad. I tested same code on 2.13 and same result. For some reason I thought that was previously working. Disregard my gaff plz. |
Deprecated in Flask 2.2, see pallets/flask#4714. Also use --app CLI option instead of FLASK_APP for consistency
Nothing in Flask ever ended up using
FLASK_ENV
/app.env
specifically. It adds a layer of complexity to the already confusing ways thatapp.debug
andapp.testing
can affect what happens internally. It's already possible to control debug mode, the debugger, and the reloader individually, there's no need for this extra switch.Feedback from users on the Discord channel, and observation of questions on Stack Overflow, suggests this env var is a source of confusion or at least extra work.
FLASK_ENV=development
is very verbose, and that isn't changing with the introduction of the--env development
option. It's much shorter to use the--debug
flag.The original idea behind
FLASK_ENV
was that it would be used likeNODE_ENV
. Nothing ever came of it though.NODE_ENV
as it's used with any frontend framework is a build-time flag, it has more meaning when it actually affects how JavaScript gets compiled, which is not something that maps to Python/Flask very well.pallets/werkzeug#2480 will make the "don't use the dev server in production" warning always shown, instead of only in certain situations. With this there will be no current difference between
FLASK_ENV=development
andFLASK_DEBUG=1
. It is also generally redundant given that the dev server should never be run in production, andFLASK_ENV
is probably only given when running the dev server.The text was updated successfully, but these errors were encountered: