<p dir="auto">To reproduce:</p>
<p dir="auto"><a href="https://github.com/PlasmaSheep/flask-bug">https://github.com/PlasmaSheep/flask-bug</a></p>
<p dir="auto">Clone repo and install flask (python2)</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="export FLASK_APP=/path/to/repo/flask-bug/autoapp.py 
flask run"><pre class="notranslate"><code class="notranslate">export FLASK_APP=/path/to/repo/flask-bug/autoapp.py 
flask run
</code></pre></div>
<p dir="auto">Notice the output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[$]&gt;&gt;&gt; flask run
Using config: development
Debug is: True
 * Serving Flask app &quot;autoapp&quot;
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)"><pre class="notranslate"><code class="notranslate">[$]&gt;&gt;&gt; flask run
Using config: development
Debug is: True
 * Serving Flask app "autoapp"
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
</code></pre></div>
<p dir="auto">So debug is enabled in the config, but the debugger is not actually active.</p>
<p dir="auto">This does work if you set the <code class="notranslate">FLASK_DEBUG</code> env variable:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[$]&gt;&gt;&gt;  flask run
 * Serving Flask app &quot;autoapp&quot;
 * Forcing debug mode on
Using config: development
Debug is: True
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
Using config: development
Debug is: True
 * Debugger is active!
 * Debugger pin code: 155-859-497"><pre class="notranslate"><code class="notranslate">[$]&gt;&gt;&gt;  flask run
 * Serving Flask app "autoapp"
 * Forcing debug mode on
Using config: development
Debug is: True
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
Using config: development
Debug is: True
 * Debugger is active!
 * Debugger pin code: 155-859-497
</code></pre></div>
<p dir="auto">However I think that the debug parameter should be specified in only one place, and that place should be the application config file so that you don't have to worry about setting environment variables for things you already specified in the config.</p>
<p dir="auto">I submitted a patch for this but learned that it was incomplete with further testing. <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="120596757" data-permission-text="Title is private" data-url="https://github.com/pallets/flask/issues/1640" data-hovercard-type="pull_request" data-hovercard-url="/pallets/flask/pull/1640/hovercard" href="https://github.com/pallets/flask/pull/1640">#1640</a></p>
<p dir="auto">Basically, it would be nice to allow <code class="notranslate">DEBUG</code> on the application to control the activation of the debugger and reloader when running the CLI like <code class="notranslate">app.run</code> does.</p>