Skip to content

Test: Implement automatic configuration for Flask #19547

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

Closed
3 tasks done
paulacamargo25 opened this issue Jul 25, 2022 · 5 comments
Closed
3 tasks done

Test: Implement automatic configuration for Flask #19547

paulacamargo25 opened this issue Jul 25, 2022 · 5 comments

Comments

@paulacamargo25
Copy link

paulacamargo25 commented Jul 25, 2022

Refs: #19451

Complexity: 3

Create Issue


Automatically detect a Flask application and run it with the correct Debug Configuration.

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 Show all automatic debug configurations.

Screen Shot 2022-07-25 at 2 09 44 PM

  1. A window will open with a list of options, choose Python.
  2. You should now see a list of debug options, and there should be the Flask option. Click it and the application should run.

Verification

  1. Make sure that the application has been executed correctly, you can put some breakpoints, to test that the debugging works.
  2. If you repeat the steps and instead of clicking the option, you click the wheel, it should open the launch.json file with the configuration prefilled. Make sure this is correct and can be debugged.
  3. Another form to show the automatic configuration is typing 'debug ' (with a space) in Quick open (⌘P) or by triggering the Debug: Select and Start Debugging command. Test that the Django Debugging recognition works here too.

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.

@alexr00
Copy link
Member

alexr00 commented Jul 26, 2022

Testing blocked for me on #19558.

@paulacamargo25
Copy link
Author

Hi @alexr00 You can try updating the python extension and try it again, it should be working now. Thank you.

@alexr00
Copy link
Member

alexr00 commented Jul 27, 2022

Updated to version v2022.11.12071744. I now see two Python debug options (one of them is flask), but still nothing appears to happen when I run them.

@paulacamargo25
Copy link
Author

Hi @alexr00 what happens when you click on the wheel?

@karthiknadig
Copy link
Member

@paulacamargo25 I tested this on Ubuntu, seems to be working for me:
image

This is my layout:
image

@alexr00 alexr00 removed their assignment Aug 2, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants