Closed
Description
Refs: #161
- macOS @meganrogge
- linux @deepak1556
- windows @rzhao271
Complexity: 3
Automatically detect a Flask file, and show it.
Steps
- Open a Flask Project if you already have one or you can also create one following the steps in the Flask Tutorial.
- Head over to the Run And Debug tab, and click on create a launch.json file.

- A window will open with a list of options, choose Python Debugger > Flask.
Verification
- Valid flask file
- Verifies that your flask config file was found correctly and is displayed in the list.
- When you hover the item, verify that there is a button to open the file and that it works correctly.
- Select this option and verify that a launch.json configuration is created with the choose option.
- Invalid flask file (you can delete or change the name of the file)
- Since no file was found, verify that a Default option is displayed.
- Select this option and verify that a launch.json configuration is created with the choose option.
- Browse a file
- Click on the option
Browse Files...
and select the file that you want. - Verify that a launch.json configuration is created with the choose option, and that the path has been parsed correctly.
- Click on the option
- Add own value
- You can also include your own text, type a path in the input box and press enter.
- Verify that a launch.json configuration is created with the choose option.
Notes
Flask's application detection works by looking for the wsgi.py, app.py and init.py files in the root or in a subdirectory just one level lower and looking for them to have the declaration of a flask application app = Flask(
. So you can try moving the python file and changing the name, and check that the detection still works.