Merge pull request #3999 from greyli/improve-cli-docs

Improve CLI docs
This commit is contained in:
David Lord 2021-05-10 23:50:04 -07:00 committed by GitHub
commit 28262c34c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 8 deletions

View file

@ -45,13 +45,13 @@ While ``FLASK_APP`` supports a variety of options for specifying your
application, most use cases should be simple. Here are the typical values: application, most use cases should be simple. Here are the typical values:
(nothing) (nothing)
The file :file:`wsgi.py` is imported, automatically detecting an app The name "app" or "wsgi" is imported (as a ".py" file, or package),
(``app``). This provides an easy way to create an app from a factory with automatically detecting an app (``app`` or ``application``) or
extra arguments. factory (``create_app`` or ``make_app``).
``FLASK_APP=hello`` ``FLASK_APP=hello``
The name is imported, automatically detecting an app (``app``) or factory The given name is imported, automatically detecting an app (``app``
(``create_app``). or ``application``) or factory (``create_app`` or ``make_app``).
---- ----

View file

@ -50,7 +50,7 @@ to tell your terminal the application to work with by exporting the
.. code-block:: text .. code-block:: text
$ export FLASK_APP=hello.py $ export FLASK_APP=hello
$ flask run $ flask run
* Running on http://127.0.0.1:5000/ * Running on http://127.0.0.1:5000/
@ -58,7 +58,7 @@ to tell your terminal the application to work with by exporting the
.. code-block:: text .. code-block:: text
> set FLASK_APP=hello.py > set FLASK_APP=hello
> flask run > flask run
* Running on http://127.0.0.1:5000/ * Running on http://127.0.0.1:5000/
@ -66,10 +66,16 @@ to tell your terminal the application to work with by exporting the
.. code-block:: text .. code-block:: text
> $env:FLASK_APP = "hello.py" > $env:FLASK_APP = "hello"
> flask run > flask run
* Running on http://127.0.0.1:5000/ * Running on http://127.0.0.1:5000/
.. admonition:: Application Discovery Behavior
As a shortcut, if the file is named ``app.py`` or ``wsgi.py``, you
don't have to set the ``FLASK_APP`` environment variable. See
:doc:`/cli` for more details.
This launches a very simple builtin server, which is good enough for This launches a very simple builtin server, which is good enough for
testing but probably not what you want to use in production. For testing but probably not what you want to use in production. For
deployment options see :doc:`deploying/index`. deployment options see :doc:`deploying/index`.