Skip to content

Commit

Permalink
Merge pull request #3999 from greyli/improve-cli-docs
Browse files Browse the repository at this point in the history
Improve CLI docs
  • Loading branch information
davidism authored May 11, 2021
2 parents 2c88e8a + 531671c commit 28262c3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
10 changes: 5 additions & 5 deletions docs/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

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

``FLASK_APP=hello``
The name is imported, automatically detecting an app (``app``) or factory
(``create_app``).
The given name is imported, automatically detecting an app (``app``
or ``application``) or factory (``create_app`` or ``make_app``).

----

Expand Down
12 changes: 9 additions & 3 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,32 @@ to tell your terminal the application to work with by exporting the

.. code-block:: text
$ export FLASK_APP=hello.py
$ export FLASK_APP=hello
$ flask run
* Running on http://127.0.0.1:5000/
.. group-tab:: CMD

.. code-block:: text
> set FLASK_APP=hello.py
> set FLASK_APP=hello
> flask run
* Running on http://127.0.0.1:5000/
.. group-tab:: Powershell

.. code-block:: text
> $env:FLASK_APP = "hello.py"
> $env:FLASK_APP = "hello"
> flask run
* 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
testing but probably not what you want to use in production. For
deployment options see :doc:`deploying/index`.
Expand Down

0 comments on commit 28262c3

Please sign in to comment.