microsoft / vscode-python-debugger

Python debugger (debugpy) extension for VS Code.
https://marketplace.visualstudio.com/items?itemName=ms-python.debugpy
MIT License
57 stars 24 forks source link

TPI: Open browser after launching a Django or flask app #221

Closed paulacamargo25 closed 7 months ago

paulacamargo25 commented 7 months ago

Refs: https://github.com/microsoft/vscode-python-debugger/issues/154

Complexity: 3

Create Issue


Prerequisites:

  1. Make sure the last pre-release version of the Python Debugger Extension has been installed.

Part 1: Test Django app

  1. Open a Django Project if you already have one or you can also create one following the steps in the Django Tutorial.
  2. Create a Django launch configuration
  3. Go to your launch.json and add to the Django config: "autoStartBrowser": true.
  4. Run the launch configuration
  5. Make sure that a browser with your application running is open with the right url and port.

Part 2: Test flask app

  1. Open a Flask Project if you already have one or you can also create one following the steps in the Flask Tutorial.
  2. Create a Flask launch configuration
  3. Follow the same steps mention above.

Part 3: Don't open browser

  1. By default this config attr is false, if the value is not in the configuration or the value is false no browser should be opened.
alexr00 commented 7 months ago

Running the python debug config doesn't work:

Recording 2024-02-20 at 12 01 52

alexr00 commented 7 months ago

Looks like the Python extension is also needed.