Skip to content

Commit a7f5b80

Browse files
committed
Add rough vscode debugging support
1 parent b74c1c9 commit a7f5b80

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Python: Attach to Docker",
6+
"type": "python",
7+
"request": "attach",
8+
"connect": {
9+
"host": "localhost",
10+
"port": 12345
11+
},
12+
"pathMappings": [
13+
{
14+
"localRoot": "${workspaceFolder}",
15+
"remoteRoot": "/code"
16+
}
17+
]
18+
}
19+
]
20+
}

requirements-dev.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
-c requirements.txt
2+
debugpy # for vscode debugging
23
django-debug-toolbar
3-
pydevd-pycharm==243.22562.180 # pinned to appropriate version for current pycharm
4+
pydevd-pycharm==243.26053.29 # pinned to appropriate version for current pycharm

requirements-dev.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ asgiref==3.8.1
44
# via
55
# -c ./requirements.txt
66
# django
7+
debugpy==1.8.13
8+
# via -r ./requirements-dev.in
79
django==4.2.16
810
# via
911
# -c ./requirements.txt
1012
# django-debug-toolbar
1113
django-debug-toolbar==4.4.6
1214
# via -r ./requirements-dev.in
13-
pydevd-pycharm==243.22562.180
15+
pydevd-pycharm==243.26053.29
1416
# via -r ./requirements-dev.in
1517
sqlparse==0.5.1
1618
# via

vscode_debugger.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def set_trace():
2+
import debugpy
3+
4+
# Listen on all interfaces at port 5678
5+
debugpy.listen(("172.17.0.1", 12345))
6+
print("Waiting for debugger to attach...")
7+
debugpy.wait_for_client() # Optional: pause execution until VS Code attaches

0 commit comments

Comments
 (0)