Merge pull request #3162 from chivalry/gunicorn-discovery-docs-update

Update documentation on gunicorn deployment and app discovery
This commit is contained in:
David Lord 2019-05-16 10:45:50 -07:00 committed by GitHub
commit 04caad0257
2 changed files with 12 additions and 6 deletions

View file

@ -68,9 +68,9 @@ parts:
The ``create_app`` factory in ``hello`` is called with the string ``'dev'`` The ``create_app`` factory in ``hello`` is called with the string ``'dev'``
as the argument. as the argument.
If ``FLASK_APP`` is not set, the command will look for a file called If ``FLASK_APP`` is not set, the command will try to import "app" or
:file:`wsgi.py` or :file:`app.py` and try to detect an application instance or "wsgi" (as a ".py" file, or package) and try to detect an application
factory. instance or factory.
Within the given import, the command looks for an application instance named Within the given import, the command looks for an application instance named
``app`` or ``application``, then any application instance. If no instance is ``app`` or ``application``, then any application instance. If no instance is

View file

@ -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 -w 4 -b 127.0.0.1:4000 myproject:app
.. _Gunicorn: http://gunicorn.org/ The ``gunicorn`` command expects the names of your application module or
.. _eventlet: http://eventlet.net/ package and the application instance within the module. If you use the
.. _greenlet: https://greenlet.readthedocs.io/en/latest/ application factory pattern, you can pass a call to that::
$ gunicorn "myproject:create_app()"
.. _Gunicorn: https://gunicorn.org/
.. _eventlet: https://eventlet.net/
uWSGI uWSGI
-------- --------