Open dev-samples opened 4 months ago
I think that debugger is supposed to run itself a python module so it isn't going to work.
Actually it looks like its working, just had to put the debugpy configs in the route:
@app.route("/")
def hello():
if(not debugpy.is_client_connected()):
debugpy.listen(('0.0.0.0', 4444))
print("Waiting for debugger attach")
debugpy.wait_for_client()
debugpy.breakpoint() #must have
I can now call that route (/) multiple times and end up in the breakpoints I have set in there.,
Not really consistent though, I did find: https://github.com/microsoft/debugpy/issues/1536 https://stackoverflow.com/questions/78288758/debugpy-problem-vs-code-debugpy-not-responding-to-cmd-thread-suspend-single-not
but not sure its 100% related
I am trying to enable debugging in vscode for an uwsgi application that is serving a Flask app.
I have found some resources here:
https://code.visualstudio.com/docs/python/tutorial-flask https://stackoverflow.com/questions/55605176/setup-uwsgi-debug-in-vs-code
The first link will work if removing uwsgi from the setup and the second link is more what I need, but its not working.
Before spending to much time on this is it a know limitation the debugging uwsgi in vscode is not supported?
app.py
wsgi.py
myproject.ini
.vscode/launch.json
And then start server with:
uwsgi --ini myproject.ini
When I run the above debug configuration from inside vscode I can see that the server is responding:
[pid: 36184|app: 0|req: 1/1] 127.0.0.1 () {10 vars in 113 bytes} [Fri May 10 22:30:51 2024] Content-Length: => generated 153 bytes in 14 msecs ( 405) 3 headers in 123 bytes (2 switches on core 0)
I just don't hit any of my breakpoints (that I have all over the place)