Commit graph

463 commits

Author SHA1 Message Date
sahilmalhotra1987
9536b1aeef feat(cli): add --json flag to flask routes command
Adds a machine-readable output mode to `flask routes`. When --json is
passed, the route table is emitted as a JSON array instead of the text
table. Each entry has `endpoint`, `methods` (sorted list), and `rule`;
subdomain apps also emit `subdomain`, host-matching apps emit `host`.
HEAD/OPTIONS are filtered unless --all-methods is also passed. Empty
apps produce `[]`. The --sort flag is honoured in JSON mode.

Backwards compatible: the flag is optional and all existing invocations
of `flask routes` are unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 12:14:25 +05:30
David Lord
3a9d54f3da
Merge branch 'stable' 2026-03-04 07:36:21 -08:00
David Lord
a29f88ce6f
document that headers must be set before streaming 2026-03-04 07:36:09 -08:00
David Lord
fbb6f0bc4c
all teardown callbacks are called despite errors 2026-02-19 19:41:50 -08:00
David Lord
7b0088693e
fix typing 2026-02-19 08:42:33 -08:00
David Lord
a411a2434b
add back opening session on context push 2026-02-19 08:35:48 -08:00
David Lord
daca74d93a
Merge branch 'stable' 2026-02-18 21:56:24 -08:00
David Lord
c17f379390
request context tracks session access 2026-02-18 19:02:54 -08:00
David Lord
e82db2ca3a
fix provide_automatic_options override 2026-02-12 13:03:03 -08:00
David Lord
c77a520343
deprecate should_ignore_error 2026-01-24 19:50:30 -08:00
David Lord
5880befcd2
Merge branch 'stable' 2026-01-24 19:05:26 -08:00
David Lord
3709c4a9a8
update ruff hook and noqa
co-authored-by: Christian Clauss <cclauss@me.com>
2026-01-24 18:58:45 -08:00
David Lord
25642fd1fd
fix annotation for select_jinja_autoescape (#5808) 2026-01-24 18:25:31 -08:00
David Lord
eca5fd1dfd
redirect defaults to 303 2026-01-24 17:16:38 -08:00
David Lord
96a01e420b
Merge branch 'stable' 2025-11-17 09:45:56 -08:00
David Lord
da6d075dfd
update dev dependencies 2025-11-17 09:43:40 -08:00
David Lord
6a64969009
pass context through dispatch methods 2025-09-19 17:33:30 -07:00
David Lord
c2705ffd9c
merge app and request context 2025-09-19 16:43:53 -07:00
subhajitsaha01
dbd4c28825 Changed the static annotated type of select_jinja_autoescape method in src/flask/sansio/app.py 2025-09-06 22:01:22 +05:30
David Lord
330123258e
Merge branch 'stable' 2025-08-19 14:09:56 -07:00
David Lord
edebd37044
rewrite docs, clean up typing for template decorators 2025-08-19 12:33:21 -07:00
kadai0308
daf1510a4b
use template_filter without parens 2025-08-19 12:33:21 -07:00
David Lord
d8259eb119
use Jinja name consistently 2025-08-19 10:43:16 -07:00
David Lord
9822a03515
refactor stream_with_context for async views 2025-08-19 08:18:55 -07:00
Tero Vuotila
d44f1c6523
relax type hint for bytes io 2025-08-18 10:22:59 -07:00
David Lord
53b8f08218
push preserved contexts in correct order 2025-08-18 09:45:56 -07:00
David Lord
e974128863
Merge branch 'stable' 2025-06-08 09:54:32 -07:00
David Lord
f04c5e6964
update dev dependencies 2025-06-08 09:52:11 -07:00
David Lord
52df9eed45
drop end of life python versions 2025-05-13 08:31:54 -07:00
David Lord
e7e5380776
Merge branch 'stable' 2025-05-13 08:10:30 -07:00
James Addison
fb54159861
secret key rotation: fix key list ordering
The `itsdangerous` serializer interface[1] expects keys to be
provided with the oldest key at index zero and the active signing key
at the end of the list.

We document[2] that `SECRET_KEY_FALLBACKS` should be configured with
the most recent first (at index zero), so to achieve the expected
behaviour, those should be inserted in reverse-order at the head of
the list.

[1] - https://itsdangerous.palletsprojects.com/en/stable/serializer/#itsdangerous.serializer.Serializer

[2] - https://flask.palletsprojects.com/en/stable/config/#SECRET_KEY_FALLBACKS
2025-05-12 18:30:27 -07:00
David Lord
0109e496f6
use uv 2025-05-11 17:58:53 -07:00
David Lord
11c45eeba3
update dev dependencies 2025-05-11 05:58:48 -07:00
David Lord
b78b5a210b
Merge branch 'stable' 2025-03-30 13:17:17 -07:00
CoolCat467
410e5ab7ed
Accept AsyncIterable for responses 2025-03-30 13:14:25 -07:00
David Lord
7d5d187458
better type checking during deprecation 2025-03-29 15:23:34 -07:00
George Waters
da60039486
Handle help arg by itself the same as no args
When the 'flask' command is used with only the '--help' parameter, this
change will make sure to try and load the app before the help callback
is run. This was previously only being done when the 'flask' command was
used by itself. This meant when passing in '--help', any custom commands
were not getting shown in the help message. With this change, custom
commands will be included in the help message when running 'flask' on
the command line by itself or with the '--help' parameter.
2025-03-29 15:13:23 -07:00
David Lord
165af0a090
update dev dependencies 2025-03-29 14:44:59 -07:00
David Lord
6b054f8f38
Merge branch 'stable' 2024-11-23 17:54:29 -08:00
kurtatter
54c3f87af9
fix type hint for cli_runner.invoke 2024-11-23 17:50:40 -08:00
David Lord
b394a994e6
update __version__ deprecation 2024-11-23 16:03:47 -08:00
David Lord
d22bfcd4cf
remove previously deprecated code 2024-11-23 15:41:36 -08:00
David Lord
22c48a738b
Merge remote-tracking branch 'origin/stable' 2024-11-13 08:43:48 -08:00
David Lord
f49dbfd3e4
use generic bases for session 2024-11-13 08:22:57 -08:00
David Lord
4f7156f2c3
configure and check trusted_hosts 2024-11-12 21:01:55 -08:00
David Lord
4995a775df
fix subdomain_matching=False behavior 2024-11-12 08:58:08 -08:00
David Lord
e13373f838
enable secret key rotation 2024-11-08 08:09:01 -08:00
David Lord
2c31603042
update env file precedence 2024-11-07 11:54:29 -08:00
David
6c44dd4bb8
update helpers.send_from_directory docstring (#5599)
Update helpers.send_from_directory docstring to match werkzeug.utils.send_from_directory docstring on the :param directory: line.
2024-11-06 09:47:57 -08:00
David Lord
98ae718976
fix mypy finding 2024-11-01 18:06:34 -07:00