As a VSCode user I want to be able to debug my FastAPI application. :tada:
The web framework is growing and I think the community will benefit from this feature. :sunglasses:
November 4, 2020: Running successfully. Tests and other requirements are missing. PR: #14606

This is awesome @Kludex ! :rocket: I'm very excited about it. :star_struck:
I have been intending to do something around it but I haven't had the time.
As you are working on it, in case it's useful, let me share what I currently do.
I normally create the file .vscode/launch.json "by hand" and have these two main configurations, one for a single file and one for a bigger application assuming it lives at app/main.py.
{
"name": "Python: FastAPI - current file",
"type": "python",
"request": "launch",
"cwd": "${fileDirname}",
"module": "uvicorn",
"args": [
"${fileBasenameNoExtension}:app"
],
"jinja": true
},
{
"name": "Python: FastAPI - app",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": [
"app.main:app"
],
"jinja": true
},
It's all based on the default Flask configs and it works very well. But it would be great if it was included by default as a template (like Django and Flask) in VS Code.
@tiangolo I'm impressed that you found this issue so fast! :1st_place_medal:
I'll probably finish it in the following days. Thank you for the snippet! :tada:
Thank you for the suggestion! We have marked this issue as "needs decision" to make sure we have a conversation about your idea. We plan to leave this feature request open for at least a month to see how many 馃憤 votes the opening comment gets to help us make our decision.
We plan to leave this feature request open for at least a month to see how many :+1: [...]
Awesome! In that case, this deserves a tweet :sweat_smile:
And just a heads-up that even if we don't accept this (we have not started discussing this yet, so this isn't foreshadowing), there is https://github.com/Microsoft/vscode-recipes for keeping this sort of thing in a centralized place for VS Code users. So any thinking or work to come up with a reasonable template will not go to waste one way or another.
Most helpful comment
This is awesome @Kludex ! :rocket: I'm very excited about it. :star_struck:
I have been intending to do something around it but I haven't had the time.
As you are working on it, in case it's useful, let me share what I currently do.
I normally create the file
.vscode/launch.json"by hand" and have these two main configurations, one for a single file and one for a bigger application assuming it lives atapp/main.py.It's all based on the default Flask configs and it works very well. But it would be great if it was included by default as a template (like Django and Flask) in VS Code.