From 0df2620c5f2fd9fa09224591952c36215cc4bda1 Mon Sep 17 00:00:00 2001 From: Charles Ross Date: Wed, 24 Apr 2019 11:17:33 -0700 Subject: [PATCH] update docs on gunicorn deploy and app discovery --- docs/cli.rst | 6 +++--- docs/deploying/wsgi-standalone.rst | 12 +++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/cli.rst b/docs/cli.rst index 6bae15db..a8dd8f24 100644 --- a/docs/cli.rst +++ b/docs/cli.rst @@ -68,9 +68,9 @@ parts: The ``create_app`` factory in ``hello`` is called with the string ``'dev'`` as the argument. -If ``FLASK_APP`` is not set, the command will look for a file called -:file:`wsgi.py` or :file:`app.py` and try to detect an application instance or -factory. +If ``FLASK_APP`` is not set, the command will try to import "app" or +"wsgi" (as a ".py" file, or package) and try to detect an application +instance or factory. Within the given import, the command looks for an application instance named ``app`` or ``application``, then any application instance. If no instance is diff --git a/docs/deploying/wsgi-standalone.rst b/docs/deploying/wsgi-standalone.rst index c2757420..a7719126 100644 --- a/docs/deploying/wsgi-standalone.rst +++ b/docs/deploying/wsgi-standalone.rst @@ -23,9 +23,15 @@ For example, to run a Flask application with 4 worker processes (``-w gunicorn -w 4 -b 127.0.0.1:4000 myproject:app -.. _Gunicorn: http://gunicorn.org/ -.. _eventlet: http://eventlet.net/ -.. _greenlet: https://greenlet.readthedocs.io/en/latest/ +The ``gunicorn`` command expects the names of your application module or +package and the application instance within the module. If you use the +application factory pattern, you can pass a call to that:: + + $ gunicorn "myproject:create_app()" + +.. _Gunicorn: https://gunicorn.org/ +.. _eventlet: https://eventlet.net/ + uWSGI --------