-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
How to setup a remote debugger with vscode #707
Comments
I had a similar issue on my Mac, and it was due to mono not being installed (https://www.mono-project.com/download/stable/) and also not set-up on my path. via export PATH=/Library/Frameworks/Mono.framework/Versions/Current/bin/:${PATH} |
@Msordet did you find any solution to this problem? |
same here.. |
I was able to debug by following the docs in VS Code but instead of adding My docker-compose setup is based on the full-stack-fastapi-postgresql cookiecutter provided by tiangolo. |
There's no need for Python code: https://github.com/Kludex/fastapi-docker-debug |
@Kludex I used your solution as a template and I can debug and hit breakpoints, thank you. Launch.json
docker-compose.debug.yml
Command to run backend in debug mode
|
You're welcome. 😗 |
resources: https://code.visualstudio.com/docs/python/debugging https://donjayamanne.github.io/pythonVSCodeDocs/docs/debugging_remote-debugging/ https://blog.hipolabs.com/remote-debugging-with-vscode-docker-and-pico-fde11f0e5f1c https://gist.github.com/veuncent/1e7fcfe891883dfc52516443a008cfcb https://ytec.nl/blog/debugging-django-vscode-without-using-noreload/ tiangolo/fastapi#707 (comment) microsoft/ptvsd#1131 https://stackoverflow.com/questions/39842422/how-does-one-use-the-vscode-debugger-to-debug-a-gunicorn-worker-process
Thanks for the discussion everyone! And nice job @Kludex ! 🚀 |
Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Description
Hi, I am trying to set up the vscode debugger with a remote container for FastAPI.
Here's my
launch.json
:In my docker-compose file, I export the ports 5678 (debugger) and 8000 (api) and the command is:
uvicorn myapp.main:app --host 0.0.0.0 --port 8000 --reload
.
In
main.py
, I've added the followling lines beforeuvicorn.run(...)
:When I try to run the debugger, I have this error happening in the vscode console (Help > Toggle Developer Tools):
In my process I checked a lot of resources to no avail such as:
The text was updated successfully, but these errors were encountered: