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

docs: add VS Code debugging config #723

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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