Commit graph

55 commits

Author SHA1 Message Date
David Lord
84c007d34f
show subdomain or host in routes output 2023-04-14 09:43:00 -07:00
Grey Li
bd26928fdb
Prefer flask run --debug in docs 2022-12-24 15:24:49 -07:00
Grey Li
4bc0e4943d
Add --debug option to flask run 2022-12-24 15:04:48 -07:00
David Lord
de16718b39
require werkzeug >= 2.2.2 2022-08-08 16:14:00 -07:00
David Lord
e3df23374c
remove env from shell banner 2022-08-05 11:29:39 -07:00
David Lord
ef95998d79
deprecate FLASK_ENV 2022-08-01 15:11:21 -07:00
David Lord
7d53a129cf
remove __traceback_hide__ 2022-08-01 10:52:12 -07:00
David Lord
5d8e35653f
refactor lazy loading
Remove the `--eager-loading/--lazy-loading` options and the
`DispatchingApp` middleware. The `run` command handles loading
exceptions directly. The reloader always prints out tracebacks
immediately and always defers raising the error.
2022-08-01 10:34:13 -07:00
David Lord
82c2e0366c
remove uses of LocalStack 2022-07-08 11:13:09 -07:00
David Lord
5544d09477
re-add flag to skip unguarded app.run from CLI 2022-06-29 21:19:28 -07:00
David Lord
c9e000b9ce
with_appcontext lasts for the lifetime of the click context 2022-06-17 11:52:01 -07:00
David Lord
99fa3c36ab
add --app, --env, --debug, and --env-file CLI options 2022-06-17 08:19:55 -07:00
David Lord
aa801c431a
FlaskGroup can be nested 2022-06-15 14:09:56 -07:00
David Lord
4f03a769d4
edit some cli messages
dev server message doesn't show one of the lines in grey
app.run message uses click.secho instead of warning
2022-06-15 12:45:22 -07:00
David Lord
1232d69860
inline conditional imports for cli behaviors 2022-05-23 09:46:20 -07:00
DailyDreaming
8ddbad9ccd Fix linting error.
Suppress mypy.

Suppress mypy error.

Suppress mypy error.
2022-05-02 09:11:07 -07:00
James Warne
5050a18a00
evaluate --cert before --key 2022-04-24 10:01:40 -07:00
David Lord
aa13521d42
lazy loading preserves click context 2022-02-22 19:04:03 -08:00
Mickaël Guérin
beae1249f7
add exclude-patterns option to flask run 2022-02-09 12:44:03 -08:00
K900
751d85f3de cli: use importlib.metadata instead of pkg_resources 2022-01-17 19:36:57 +03:00
David Lord
6b0c8cdac1
Merge branch '2.0.x' 2021-11-16 06:30:19 -08:00
Henry Kobin
e679a85b80
made ImportError verbose in cli.py 2021-11-15 14:00:23 -08:00
David Lord
e21e003f62
remove deprecated script_info factory arg 2021-11-12 09:52:16 -08:00
David Lord
6a4bf9eec1
use exception chaining
fixes flake8-bugbear B904
2021-10-01 09:39:10 -07:00
na2shell
9f0da9b770
cli loader handles kwargs in app factory 2021-08-05 19:32:43 -07:00
Rohan salwan
aa6dd09c2c
correctly handle raising deferred errors in cli lazy loading 2021-08-05 19:14:51 -07:00
Adrian Moennich
26a6cc0f94 Allow using Click 7 with a DeprecationWarning
As long as popular libraries (e.g. Celery) require click 7, depending
on Click 8 in Flask makes it hard to test the latest version (and its
other dependencies) in existing applications.
2021-04-27 16:45:06 +02:00
pgjones
77237093da Add initial type hints
This should make it easier for users to correctly use Flask. The hints
are from Quart.
2021-04-26 17:29:53 +01:00
David Lord
8ab4967703
consistent versions and deprecation messages 2021-04-15 15:58:24 -07:00
David Lord
32272da9ac
shell calls sys.__interativehook__
This will set up readline tab and history completion by default.
2021-04-14 10:01:32 -07:00
Grey Li
33145c3699 Set default encoding to UTF-8 for load_dotenv 2021-03-10 21:40:29 +08:00
David Lord
055cdc2625
click detects program name when run as module 2021-01-29 11:29:36 -08:00
David Lord
967b235035
Merge pull request #3728 from nphilipp/master--discover-app-factory-deterministically
Discover app factory deterministically
2020-10-15 14:01:14 -07:00
ongopongo
5bfe236fb5
fix typo in flask shell help (#3744) 2020-08-26 09:20:21 -07:00
Nils Philippsen
cf3089a8f8 Discover app factory deterministically
Commit 2ae740dd49 probably inadvertently
changed to iterate over a set of "create_app", "make_app" to discover
application factory functions. As sets don't guarantee order,
differences in the implementation of the type can make it
non-deterministic which factory function is used if a project implements
both. Revert to using a tuple.

Signed-off-by: Nils Philippsen <nils@redhat.com>
2020-08-13 10:44:43 +02:00
David Lord
253570784c
cleaner message when CLI can't load app
When loading the app fails for the --help command, only the error
message is shown, then the help text. The full traceback is shown for
other exceptions. Also show the message when loading fails while
getting a command, instead of only "command not found". The error
message goes to stderr to match other error behavior, and is in red
with an extra newline to make it more obvious next to the help text.

Also fixes an issue with the test_apps fixture that caused an imported
app to still be importable after the test was over and the path was
reset. Now the module cache is reset as well.
2020-07-30 18:36:55 -07:00
Grey Li
84cbfc0698 Stop change CWD to .env/.flaskenv location 2020-07-05 09:37:03 +08:00
David Lord
ff2f71379b
use ast to parse FLASK_APP
enables keyword arguments to factory functions
2020-04-07 17:54:51 -07:00
David Lord
fcac7f11cf
deprecate passing script_info to factory 2020-04-07 15:54:36 -07:00
David Lord
171aabc87d
remove unused ref directives
replace page refs with doc directives
2020-04-04 12:57:14 -07:00
David Lord
f2f027d1fb
remove unused module docstrings 2020-04-04 12:28:08 -07:00
David Lord
2ae740dd49
f-strings everywhere 2020-04-04 12:10:00 -07:00
David Lord
524fd0bc8c
apply pyupgrade 2020-04-04 12:10:00 -07:00
David Lord
57d628ca74
remove more compat code 2020-04-04 12:10:00 -07:00
David Lord
662c245795
remove _compat module 2020-04-04 12:10:00 -07:00
David Lord
bcde664f9a
cli checks for cryptography library 2020-02-10 17:34:19 -08:00
David Lord
a671e47921
rewrite the development server docs 2019-11-18 18:02:12 -08:00
David Lord
240a11052b
lazy load app on reload only 2019-11-18 17:54:46 -08:00
David Lord
c478e5d52f
pass sys.argv to flask cli 2019-07-10 11:45:20 -07:00
David Lord
2844fdb82e
Merge branch '1.0.x' 2019-07-03 12:23:16 -07:00