<div dir="ltr">I'm casting about for a useful Flask template for more serious applications. I've done one or two very small Flask apps manually, but thought it would be nice to see what sort of structures people use for more complex stuff.<div><br></div><div>I installed cookiecutter into my Anaconda environment. (That was a chore because <a href="http://anaconda.org">anaconda.org</a> <a href="https://github.com/conda/conda/issues/3399">keeps complaining that I'm not authorized</a>, so I had to download and install it and its dependencies manually. Not great fun.) Then I instantiated this template:</div><div><br></div><div><a href="https://github.com/sloria/cookiecutter-flask">https://github.com/sloria/cookiecutter-flask</a><br></div><div><br></div><div>and answered the simple questions it asked (name, title, description, etc.) Then, looking at these instructions:</div><div><br></div><div><a href="https://github.com/sloria/cookiecutter-flask/blob/master/%7B%7Bcookiecutter.app_name%7D%7D/README.rst#quickstart">https://github.com/sloria/cookiecutter-flask/blob/master/%7B%7Bcookiecutter.app_name%7D%7D/README.rst#quickstart</a><br></div><div><br></div><div>I saw a bit more than I hoped for. So far, in my trivial applications, I've just run from the repo (no installation). I figured this would be all I needed:</div><div><br></div><div><div>export {{cookiecutter.app_name | upper}}_SECRET='something-really-secret'</div><div>export FLASK_APP=/path/to/autoapp.py<br></div><div>export FLASK_DEBUG=1</div></div><div>flask run<br></div><div><br></div><div>When I visit the app's URL, I keep getting</div><div><br></div><div><div>flask.cli.NoAppException: The file/path provided (manage) does not appear to exist.  Please verify the path is correct.  If app is not on PYTHONPATH, ensure the extension is .py<br></div></div><div><br></div><div>So I tried another template:</div><div><br></div><div><a href="https://github.com/JackStouffer/cookiecutter-Flask-Foundation">https://github.com/JackStouffer/cookiecutter-Flask-Foundation</a><br></div><div><br></div><div>Same drill. Answer the questions, set the FLASK environment variables, run the flask app:</div><div><br></div><div><div>(anaconda) stouffer-flask% pwd</div><div>/home/skip/src/stouffer-flask</div><div>(anaconda) stouffer-flask% cd defunct_archiver/</div><div>(anaconda) defunct_archiver% ls</div><div>defunct_archiver  manage.py    README.md         tests</div><div>Makefile          __pycache__  requirements.txt</div><div>(anaconda) defunct_archiver% export FLASK_APP=${PWD}/manage.py</div><div>(anaconda) defunct_archiver% export FLASK_DEBUG=1</div><div>(anaconda) defunct_archiver% flask run</div><div> * Serving Flask app "manage"</div><div> * Forcing debug mode on</div><div>/home/skip/src/stouffer-flask/defunct_archiver/manage.py:5: ExtDeprecationWarning: Importing flask.ext.script is deprecated, use flask_script instead.</div><div>  from flask.ext.script import Manager, Server</div><div> * Running on <a href="http://127.0.0.1:5000/">http://127.0.0.1:5000/</a> (Press CTRL+C to quit)</div><div> * Restarting with stat</div><div>/home/skip/src/stouffer-flask/defunct_archiver/manage.py:5: ExtDeprecationWarning: Importing flask.ext.script is deprecated, use flask_script instead.</div><div>  from flask.ext.script import Manager, Server</div><div> * Debugger is active!</div><div> * Debugger PIN: 104-595-126</div><div><br></div><div>Then I visit <a href="http://127.0.0.1:5000/">http://127.0.0.1:5000/</a> and get the same 500 response.</div><div><br></div><div>127.0.0.1 - - [17/Apr/2017 13:23:39] "GET / HTTP/1.1" 500 -</div><div>Traceback (most recent call last):</div><div>  File "/home/skip/anaconda3/envs/anaconda/lib/python3.6/site-packages/flask/cli.py", line 178, in __call__</div><div>    self._flush_bg_loading_exception()</div><div>  File "/home/skip/anaconda3/envs/anaconda/lib/python3.6/site-packages/flask/cli.py", line 166, in _flush_bg_loading_exception</div><div>    reraise(*exc_info)</div><div>  File "/home/skip/anaconda3/envs/anaconda/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise</div><div>    raise value</div><div>  File "/home/skip/anaconda3/envs/anaconda/lib/python3.6/site-packages/flask/cli.py", line 155, in _load_app</div><div>    self._load_unlocked()</div><div>  File "/home/skip/anaconda3/envs/anaconda/lib/python3.6/site-packages/flask/cli.py", line 170, in _load_unlocked</div><div>    self._app = rv = self.loader()</div><div>  File "/home/skip/anaconda3/envs/anaconda/lib/python3.6/site-packages/flask/cli.py", line 231, in load_app</div><div>    rv = locate_app(self.app_import_path)</div><div>  File "/home/skip/anaconda3/envs/anaconda/lib/python3.6/site-packages/flask/cli.py", line 95, in locate_app</div><div>    'is .py' % module)</div><div>flask.cli.NoAppException: The file/path provided (manage) does not appear to exist.  Please verify the path is correct.  If app is not on PYTHONPATH, ensure the extension is .py</div></div><div><br></div><div>Shouldn't I be able to bring up one of these skeletal Flask apps from my local repo without having to go through the labor of packaging and installing it? Is there some underlying exception getting raised and tossed in favor of the higher level NoAppException? If so, is there some way to get at it?</div><div><br></div><div>Thx,</div><div><br></div><div>Skip Montanaro</div><div><br></div></div>