diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..bb63fcb5f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Attach to Docker", + "type": "python", + "request": "attach", + "connect": { + "host": "localhost", + "port": 12345 + }, + "pathMappings": [ + { + "localRoot": "${workspaceFolder}", + "remoteRoot": "/code" + } + ] + } + ] +} diff --git a/requirements-dev.in b/requirements-dev.in index a68056b87..36ed56137 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -1,3 +1,4 @@ -c requirements.txt +debugpy # for vscode debugging django-debug-toolbar -pydevd-pycharm==243.22562.180 # pinned to appropriate version for current pycharm +pydevd-pycharm==243.26053.29 # pinned to appropriate version for current pycharm diff --git a/requirements-dev.txt b/requirements-dev.txt index bddfe9efa..a0a3c9abc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,13 +4,15 @@ asgiref==3.8.1 # via # -c ./requirements.txt # django +debugpy==1.8.13 + # via -r ./requirements-dev.in django==4.2.16 # via # -c ./requirements.txt # django-debug-toolbar django-debug-toolbar==4.4.6 # via -r ./requirements-dev.in -pydevd-pycharm==243.22562.180 +pydevd-pycharm==243.26053.29 # via -r ./requirements-dev.in sqlparse==0.5.1 # via diff --git a/vscode_debugger.py b/vscode_debugger.py new file mode 100644 index 000000000..dc8343c22 --- /dev/null +++ b/vscode_debugger.py @@ -0,0 +1,7 @@ +def set_trace(): + import debugpy + + # Listen on all interfaces at port 5678 + debugpy.listen(("172.17.0.1", 12345)) + print("Waiting for debugger to attach...") + debugpy.wait_for_client() # Optional: pause execution until VS Code attaches