Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 99112

How to run a flask app into VS Code by button instead of going to the startup file?

$
0
0

I have a flask program into VS Code. After config project, I expect that click debugging button will run the app with debug mode. So it happens, but only first time.

When I click a stop button and again debugging - comes the error. I don't see that when click debugging button instead the window with text after delay.

enter image description here

If I run last terminal command, will the error ConnectionRefusedError: [WinError 10061].

"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

If I run only, the app was running

flask run --no-debugger --no-reload

Why after success the first run with debugging button, every next with error ones of describe above? What do I need to do to run the project by button? Now have to either re-enter the VS Code or go to the startup file and run it. It's awkward.

The app has the next config and structure

"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
        }
    ]

enter image description hereenter image description here


Viewing all articles
Browse latest Browse all 99112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>