<div dir="ltr"><div>Hi,</div><div><br></div><div>I have been writing my first program using flask and ran into some confusion when writing the my_application.wsgi file. I followed the tutorial application structure, using a create_app() function in a file called __init__.py. I installed the project in a virtualenv.<br></div><div><br></div><div>The flask docs say that for most apps the following file should be sufficient: `<span class="gmail-kn">from</span> <span class="gmail-nn">yourapplication</span> <span class="gmail-k">import</span> <span class="gmail-n">app</span> <span class="gmail-k">as</span> <span class="gmail-n">application`. When I tried to use a file like this I get `TypeError: 'module' object not callable` in the apache logs.</span></div><div><span class="gmail-n"><br></span></div><div><span class="gmail-n">After some searching I found that the correct way to import an app like that is:</span></div><div><span class="gmail-n"><br></span></div><div><span class="gmail-n">```<br></span></div><div><span class="gmail-n">from app import create_app</span></div><div><span class="gmail-n">application = create_app()</span></div><div><span class="gmail-n">```<br></span></div><div><span class="gmail-n"><br></span></div><div><span class="gmail-n">This is the first time I have written a python project which can be installed in this way. I would like to know if this is the expected way to have to import a project written with a factory function in __init__.py?</span></div><div><span class="gmail-n"><br></span></div><div><span class="gmail-n">If so, I think it would be useful to have a comment stating so in the docs. I am happy to create a pull request if so.</span></div><div><span class="gmail-n"><br></span></div><div><span class="gmail-n">I am using:</span></div><div><span class="gmail-n">python 3.5.3</span></div><div><span class="gmail-n">flask 1.0.2</span></div><div><span class="gmail-n">mod_wsgi 4.5.11-1, installed from raspbian stretch repositories</span></div><div><span class="gmail-n">Raspbian Stretch<br></span></div><div><span class="gmail-n"><br></span></div><div><span class="gmail-n"><br></span></div><div><span class="gmail-n">Thanks,</span></div><div><span class="gmail-n">Emlyn<br></span></div></div>