Skip to content
Myr

Improve the wording of using FLASK_APP

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Grey Li · committed by David Lord · parent 2c88e8a · Browse files · 2 files+14 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−8 removed

  • other:+14 added−8 removed

2 files+14 added−8 removed

modified:docs/cli.rst+5 added-5 removed
43 unmodified lines
44While ``FLASK_APP`` supports a variety of options for specifying your45application, most use cases should be simple. Here are the typical values:4647(nothing)48 The file :file:`wsgi.py` is imported, automatically detecting an app49 (``app``). This provides an easy way to create an app from a factory with50 extra arguments.48 The name "app" or "wsgi" is imported (as a ".py" file, or package),49 automatically detecting an app (``app`` or ``application``) or50 factory (``create_app`` or ``make_app``).5152``FLASK_APP=hello``53 The name is imported, automatically detecting an app (``app``) or factory54 (``create_app``).53 The given name is imported, automatically detecting an app (``app``54 or ``application``) or factory (``create_app`` or ``make_app``).5556----5758``FLASK_APP`` has three parts: an optional path that sets the current working
596 unmodified lines
modified:docs/quickstart.rst+9 added-3 removed
48 unmodified lines
49 .. group-tab:: Bash5051 .. code-block:: text5253 $ export FLASK_APP=hello.py53 $ export FLASK_APP=hello54 $ flask run55 * Running on http://127.0.0.1:5000/5657 .. group-tab:: CMD5859 .. code-block:: text6061 > set FLASK_APP=hello.py61 > set FLASK_APP=hello62 > flask run63 * Running on http://127.0.0.1:5000/6465 .. group-tab:: Powershell6667 .. code-block:: text6869 > $env:FLASK_APP = "hello.py"69 > $env:FLASK_APP = "hello"70 > flask run71 * Running on http://127.0.0.1:5000/7273.. admonition:: Application Discovery Behavior7475 As a shortcut, if the file is named ``app.py`` or ``wsgi.py``, you76 don't have to set the ``FLASK_APP`` environment variable. See77 :doc:`/cli` for more details.7879This launches a very simple builtin server, which is good enough for80testing but probably not what you want to use in production. For81deployment options see :doc:`deploying/index`.82
856 unmodified lines