Browse Source

document wsgi.py and app.py default modules

pull/2378/head
Miguel Grinberg 8 years ago
parent
commit
0b80acb25c
No known key found for this signature in database
GPG Key ID: 36848B262DF5F06C
  1. 10
      docs/cli.rst

10
docs/cli.rst

@ -26,9 +26,13 @@ built-in commands that are always there. Flask extensions can also
register more commands there if they desire so.
For the :command:`flask` script to work, an application needs to be
discovered. This is achieved by exporting the ``FLASK_APP`` environment
variable. It can be either set to an import path or to a filename of a
Python module that contains a Flask application.
discovered. Flask looks for a module named wsgi.py or app.py by default, and
if it finds one it assumes the application is defined in it.
You can instruct Flask to look for the application in a different module by
exporting the ``FLASK_APP`` environment variable. It can be either set to an
import path or to a filename of a Python module that contains a Flask
application.
In that imported file the name of the app needs to be called ``app`` or
optionally be specified after a colon. For instance

Loading…
Cancel
Save