File tree 2 files changed +14
-8
lines changed
2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,13 @@ While ``FLASK_APP`` supports a variety of options for specifying your
45
45
application, most use cases should be simple. Here are the typical values:
46
46
47
47
(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 ``) .
51
51
52
52
``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 ``).
55
55
56
56
----
57
57
Original file line number Diff line number Diff line change @@ -50,26 +50,32 @@ to tell your terminal the application to work with by exporting the
50
50
51
51
.. code-block :: text
52
52
53
- $ export FLASK_APP=hello.py
53
+ $ export FLASK_APP=hello
54
54
$ flask run
55
55
* Running on http://127.0.0.1:5000/
56
56
57
57
.. group-tab :: CMD
58
58
59
59
.. code-block :: text
60
60
61
- > set FLASK_APP=hello.py
61
+ > set FLASK_APP=hello
62
62
> flask run
63
63
* Running on http://127.0.0.1:5000/
64
64
65
65
.. group-tab :: Powershell
66
66
67
67
.. code-block :: text
68
68
69
- > $env:FLASK_APP = "hello.py "
69
+ > $env:FLASK_APP = "hello"
70
70
> flask run
71
71
* Running on http://127.0.0.1:5000/
72
72
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
+
73
79
This launches a very simple builtin server, which is good enough for
74
80
testing but probably not what you want to use in production. For
75
81
deployment options see :doc: `deploying/index `.
You can’t perform that action at this time.
0 commit comments