Skip to content

Commit

Permalink
docs: add VS Code debugging config
Browse files Browse the repository at this point in the history
  • Loading branch information
Samk13 authored and fenekku committed Jan 8, 2025
1 parent c8c5c9c commit 8a85a97
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/develop/getting-started/debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,46 @@ To set a breakpoint place the following code:
breakpoint()
```

## VS Code Debugger

To debug InvenioRDM using VS Code, configure the debugger with Flask settings:

From your instance, create or edit `.vscode/launch.json`.
Add the following configuration, see link for more information: [VS Code debugging](https://code.visualstudio.com/docs/python/debugging)

```json
// .vscode/launch.json
{
"configurations": [
{
"name": "Invenio Debugger",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "invenio_app.wsgi:application",
"FLASK_ENV": "development",
"FLASK_DEBUG": "1",
"WERKZEUG_RUN_MAIN": "watchdog"
},
"args": [
"run",
"--host",
"0.0.0.0",
"--cert",
"${workspaceFolder}/docker/nginx/test.crt",
"--key",
"${workspaceFolder}/docker/nginx/test.key"
],
"jinja": true,
"justMyCode": false
}
]
}
```

Start debugging in VS Code by selecting Invenio Debugger in the debug panel and clicking Run.

**Flask DebugToolbar**

You can also install [Flask-DebugToolbar](https://flask-debugtoolbar.readthedocs.io/en/latest/):
Expand Down

0 comments on commit 8a85a97

Please sign in to comment.