Skip to content

Commit 6ff3dd5

Browse files
authored
Merge pull request #7856 from microsoft/cwebster-99-patch-1
Update tutorial-fastapi.md
2 parents 8656303 + 9b47e0e commit 6ff3dd5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/python/tutorial-fastapi.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,19 @@ Let's create the application!
119119
120120
![Dropdown with debugger configuration options, with FastAPI being highlighted](images/fastapi-tutorial/fastapi_debug_config_option.png)
121121
122-
This invokes uvicorn to start the application server through the debugger and allow you to step through the source code to inspect its behavior. You should see something like the following in the terminal:
122+
This automatically creates a debug configuration that invokes uvicorn to start the application server through the debugger and allows you to step through the source code to inspect its behavior. You should see something like the following in the terminal:
123123
124124
![Uvicorn server running message displayed in the terminal, with an URL to access the app](images/fastapi-tutorial/fastapi_debug_terminal.png)
125125
126-
6. `kbstyle(Ctrl+Click)` the `http://127.0.0.1:8000/` URL in the terminal to open your default browser to that address:
126+
>**Tip**: In the case where your default port is already in use, stop the debugger and open the Command Palette (`kb(workbench.action.showCommands)`), search for **Debug: Add Configuration**, select Python Debugger, and then FastAPI. This will create a custom config file in `.vscode/launch.json` that you can edit. Add the following to `"args":[]` to set a custom port: `"--port=5000"`. Save the file, and restart the debugger using (`kb(workbench.action.debug.start)`).
127+
128+
7. `kbstyle(Ctrl+Click)` the `http://127.0.0.1:8000/` URL in the terminal to open your default browser to that address:
127129
128130
![Hello World message displayed in the browser](images/fastapi-tutorial/helloworld_browser.png)
129131
130132
Congratulations! Your FastAPI app is up and running!
131133
132-
7. Stop the debugger by using the **Stop** button in the debug toolbar, or through `kb(workbench.action.debug.stop)`.
134+
8. Stop the debugger by using the **Stop** button in the debug toolbar, or through `kb(workbench.action.debug.stop)`.
133135
134136
## Create a model for grocery list items
135137

0 commit comments

Comments
 (0)