<p dir="auto">When following the tutorial, I could not run <code class="notranslate">$ flask initdb</code>.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/Users/dvf/environments/flaskTutorial/bin/flask&quot;, line 11, in &lt;module&gt;
    sys.exit(main())
  File &quot;/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py&quot;, line 502, in main
    cli.main(args=args, prog_name=name)
  File &quot;/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py&quot;, line 369, in main
    return AppGroup.main(self, *args, **kwargs)
  File &quot;/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/click/core.py&quot;, line 696, in main
    rv = self.invoke(ctx)
  File &quot;/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/click/core.py&quot;, line 1055, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File &quot;/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/click/core.py&quot;, line 1094, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File &quot;/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py&quot;, line 340, in get_command
    rv = info.load_app().cli.get_command(ctx, name)
  File &quot;/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py&quot;, line 226, in load_app
    rv = locate_app(self.app_import_path)
  File &quot;/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py&quot;, line 90, in locate_app
    __import__(module)
ImportError: No module named flaskr"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "/Users/dvf/environments/flaskTutorial/bin/flask", line 11, in &lt;module&gt;
    sys.exit(main())
  File "/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py", line 502, in main
    cli.main(args=args, prog_name=name)
  File "/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py", line 369, in main
    return AppGroup.main(self, *args, **kwargs)
  File "/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/click/core.py", line 1055, in invoke
    cmd_name, cmd, args = self.resolve_command(ctx, args)
  File "/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/click/core.py", line 1094, in resolve_command
    cmd = self.get_command(ctx, cmd_name)
  File "/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py", line 340, in get_command
    rv = info.load_app().cli.get_command(ctx, name)
  File "/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py", line 226, in load_app
    rv = locate_app(self.app_import_path)
  File "/Users/dvf/environments/flaskTutorial/lib/python2.7/site-packages/flask_cli/cli.py", line 90, in locate_app
    __import__(module)
ImportError: No module named flaskr
</code></pre></div>
<p dir="auto">This was fixed by changing the environment variable to:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export FLASK_APP=flaskr.py"><pre class="notranslate"><code class="notranslate">export FLASK_APP=flaskr.py
</code></pre></div>
<p dir="auto">On OS X 10.11.3 and Python 2.7.12</p>
<p dir="auto">on <a href="http://flask.pocoo.org/docs/templating/" rel="nofollow">http://flask.pocoo.org/docs/templating/</a><br>
the "Jinja2 Template Documentation" link at the top of the page gives a 404 error.<br>
update link to <a href="http://jinja.pocoo.org/docs/templates/#" rel="nofollow">http://jinja.pocoo.org/docs/templates/#</a></p>