Flask v2.1.0 Release Notes
-
๐ Released 2022-03-28
- ๐ Drop support for Python 3.6. :pr:
4335
- โก๏ธ Update Click dependency to >= 8.0. :pr:
4008
๐ Remove previously deprecated code. :pr:
4337
- The CLI does not pass
script_info
to app factory functions. -
config.from_json
is replaced byconfig.from_file(name, load=json.load)
. -
json
functions no longer take anencoding
parameter. -
safe_join
is removed, usewerkzeug.utils.safe_join
instead. -
total_seconds
is removed, usetimedelta.total_seconds
instead. - The same blueprint cannot be registered with the same name. Use
name=
when registering to specify a unique name. - The test client's
as_tuple
parameter is removed. Useresponse.request.environ
instead. :pr:4417
- The CLI does not pass
Some parameters in
send_file
andsend_from_directory
were renamed in 2.0. The deprecation period for the old names is extended to 2.2. Be sure to test with deprecation warnings visible.-
attachment_filename
is renamed todownload_name
. -
cache_timeout
is renamed tomax_age
. -
add_etags
is renamed toetag
. -
filename
is renamed topath
.
-
๐ The
RequestContext.g
property is deprecated. Useg
directly orAppContext.g
instead. :issue:3898
copy_current_request_context
can decorate async functions. :pr:4303
๐ The CLI uses
importlib.metadata
instead ofsetuptools
to load command entry points. :issue:4419
Overriding
FlaskClient.open
will not cause an error on redirect. :issue:3396
Add an
--exclude-patterns
option to theflask run
CLI command to specify patterns that will be ignored by the reloader. :issue:4188
0๏ธโฃ When using lazy loading (the default with the debugger), the Click context from the
flask run
command remains available in the loader thread. :issue:4460
Deleting the session cookie uses the
httponly
flag. :issue:4485
Relax typing for
errorhandler
to allow the user to use more precise types and decorate the same function multiple times. :issue:4095, 4295, 4297
Fix typing for
__exit__
methods for better compatibility withExitStack
. :issue:4474
From Werkzeug, for redirect responses the
Location
header URL will remain relative, and exclude the scheme and domain, by default. :pr:4496
๐ Add
Config.from_prefixed_env()
to load config values from environment variables that start withFLASK_
or another prefix. This parses values as JSON by default, and allows setting keys in nested dicts. :pr:4479
- ๐ Drop support for Python 3.6. :pr: