Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TPI: Improve debug config selection in Flask #280

Closed
3 tasks done
paulacamargo25 opened this issue Mar 24, 2024 · 2 comments
Closed
3 tasks done

TPI: Improve debug config selection in Flask #280

paulacamargo25 opened this issue Mar 24, 2024 · 2 comments

Comments

@paulacamargo25
Copy link
Contributor

paulacamargo25 commented Mar 24, 2024

Refs: #161

Complexity: 3

Create Issue


Automatically detect a Flask file, and show it.

Steps

  1. Open a Flask Project if you already have one or you can also create one following the steps in the Flask Tutorial.
  2. Head over to the Run And Debug tab, and click on create a launch.json file.
Screenshot 2024-03-24 at 11 31 32 AM
  1. A window will open with a list of options, choose Python Debugger > Flask.

Verification

  1. Valid flask file
    1. Verifies that your flask config file was found correctly and is displayed in the list.
    2. When you hover the item, verify that there is a button to open the file and that it works correctly.
    3. Select this option and verify that a launch.json configuration is created with the choose option.
  2. Invalid flask file (you can delete or change the name of the file)
    1. Since no file was found, verify that a Default option is displayed.
    2. Select this option and verify that a launch.json configuration is created with the choose option.
  3. Browse a file
    1. Click on the option Browse Files... and select the file that you want.
    2. Verify that a launch.json configuration is created with the choose option, and that the path has been parsed correctly.
  4. Add own value
    1. You can also include your own text, type a path in the input box and press enter.
    2. 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.

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Mar 24, 2024
@paulacamargo25 paulacamargo25 added this to the March 2024 milestone Mar 24, 2024
@paulacamargo25 paulacamargo25 removed the triage-needed Needs assignment to the proper sub-team label Mar 24, 2024
@jrieken
Copy link
Member

jrieken commented Mar 25, 2024

A window will open with a list of options, choose Python Debugger > Django.

@paulacamargo25 Are you sure about "Django"? Shouldn't it be "Flask"?

@paulacamargo25
Copy link
Contributor Author

A window will open with a list of options, choose Python Debugger > Django.

@paulacamargo25 Are you sure about "Django"? Shouldn't it be "Flask"?

Yes sorry, i just update the description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants