From 5e07e3a6ada63e322597dd1ca25fecff25d0ae8d Mon Sep 17 00:00:00 2001 From: Emlyn Price Date: Fri, 4 Jan 2019 22:12:53 +0000 Subject: [PATCH] Add comment about using factory function in __init__.py --- docs/deploying/mod_wsgi.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/deploying/mod_wsgi.rst b/docs/deploying/mod_wsgi.rst index a0643c42..203e0d36 100644 --- a/docs/deploying/mod_wsgi.rst +++ b/docs/deploying/mod_wsgi.rst @@ -61,6 +61,11 @@ For most applications the following file should be sufficient:: from yourapplication import app as application +If a factory function is used in a :file:`__init__.py` file, then the function should be imported:: + + from yourapplication import create_app + application = create_app() + If you don't have a factory function for application creation but a singleton instance you can directly import that one as `application`.