From 0b80acb25cb4ee3f2acad6ae8064d834e0583408 Mon Sep 17 00:00:00 2001 From: Miguel Grinberg Date: Thu, 15 Jun 2017 12:15:38 -0700 Subject: [PATCH] document wsgi.py and app.py default modules --- docs/cli.rst | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index 1c06f343..8fbfe962 100644 --- a/docs/cli.rst +++ b/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