Skip to content

Commit 28262c3

Browse files
authored
Merge pull request #3999 from greyli/improve-cli-docs
Improve CLI docs
2 parents 2c88e8a + 531671c commit 28262c3

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

docs/cli.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ While ``FLASK_APP`` supports a variety of options for specifying your
4545
application, most use cases should be simple. Here are the typical values:
4646

4747
(nothing)
48-
The file :file:`wsgi.py` is imported, automatically detecting an app
49-
(``app``). This provides an easy way to create an app from a factory with
50-
extra arguments.
48+
The name "app" or "wsgi" is imported (as a ".py" file, or package),
49+
automatically detecting an app (``app`` or ``application``) or
50+
factory (``create_app`` or ``make_app``).
5151

5252
``FLASK_APP=hello``
53-
The name is imported, automatically detecting an app (``app``) or factory
54-
(``create_app``).
53+
The given name is imported, automatically detecting an app (``app``
54+
or ``application``) or factory (``create_app`` or ``make_app``).
5555

5656
----
5757

docs/quickstart.rst

+9-3
Original file line numberDiff line numberDiff line change
@@ -50,26 +50,32 @@ to tell your terminal the application to work with by exporting the
5050

5151
.. code-block:: text
5252
53-
$ export FLASK_APP=hello.py
53+
$ export FLASK_APP=hello
5454
$ flask run
5555
* Running on http://127.0.0.1:5000/
5656
5757
.. group-tab:: CMD
5858

5959
.. code-block:: text
6060
61-
> set FLASK_APP=hello.py
61+
> set FLASK_APP=hello
6262
> flask run
6363
* Running on http://127.0.0.1:5000/
6464
6565
.. group-tab:: Powershell
6666

6767
.. code-block:: text
6868
69-
> $env:FLASK_APP = "hello.py"
69+
> $env:FLASK_APP = "hello"
7070
> flask run
7171
* Running on http://127.0.0.1:5000/
7272
73+
.. admonition:: Application Discovery Behavior
74+
75+
As a shortcut, if the file is named ``app.py`` or ``wsgi.py``, you
76+
don't have to set the ``FLASK_APP`` environment variable. See
77+
:doc:`/cli` for more details.
78+
7379
This launches a very simple builtin server, which is good enough for
7480
testing but probably not what you want to use in production. For
7581
deployment options see :doc:`deploying/index`.

0 commit comments

Comments
 (0)