title: How to run a flask app into VS Code by button instead of going to the startup file?
body: <p>I have a <code>flask</code> program into <code>VS Code</code>. After config project, I expect that click <code>debugging button</code> will run the app with debug mode. So it happens, but <strong>only</strong> first time.</p>
  
  <p>When I click a <code>stop button</code> and again <code>debugging</code> - comes the error. I don't see that when click <code>debugging button</code> instead the window with text after delay. </p>
  
  <p><a href="https://i.stack.imgur.com/AACJ6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AACJ6.png" alt="enter image description here"></a></p>
  
  <p>If I run last terminal command, will the error <code>ConnectionRefusedError: [WinError 10061]</code>.</p>
  
  <pre><code>"d:\Python Projects\HelloFlask\venv\Scripts\python.exe" c:\Users\Owl\.vscode\extensions\ms-python.python-2019.11.50794\pythonFiles\ptvsd_launcher.py
  --default --client --host localhost --port 56369 -m flask run --no-debugger --no-reload
  </code></pre>
  
  <p>If I run only, the app was running </p>
  
  <pre><code>flask run --no-debugger --no-reload
  </code></pre>
  
  <p>Why after success the first run with <code>debugging button</code>, every next with error ones of describe above? What do I need to do to run the project <strong>by button</strong>? Now have to either re-enter the VS Code or go to the startup file and run it. It's awkward.</p>
  
  <p>The app has the next config and structure </p>
  
  <pre><code>"version": "0.2.0",
      "configurations": [
          {
              "name": "Python: Flask",
              "type": "python",
              "request": "launch",
              "module": "flask",
              "env": {
                  "FLASK_APP": "runserver.py"
              },
              "args": [
                  "run",
                  "--no-debugger",
                  "--no-reload"
              ],
              "jinja": true
          }
      ]
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/BYsPd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BYsPd.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/mohay.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mohay.png" alt="enter image description here"></a></p>