1👍
My issue were missing packages. Docker usually works fine, I haven’t had any issues before at all.
I originally installed docker like described in the official documentation:
https://docs.docker.com/engine/install/ubuntu/
But after I tried installing the docker.io
package, debugging worked fine in VS Code:
sudo apt install docker.io
2👍
The idea of debugging in vs code is to:
- use debugpy to launch your code with a port, say 5678
- in vscode to ‘Remote Attach’ to that process.
I may be wrong but what i can see from your code, you didn’t attach to your process.
I wrote the way I did here, I use docker-compose and docker. My way is different with yours but you will get the idea…:)
- [Django]-BI with Django?
- [Django]-How to use a wordpress blog theme on a django-based website
- [Django]-Django: composite fields or embedded classes (like JPA)?
- [Django]-Create method for foreign key relationships with Django Rest Framework serializers
0👍
There’s no errors compared to the vscode tutorial in your project. Cause the error is timeout waiting for luncher to connect, try restart docker service and reload your window in vscode.
0👍
Here is a clue and a workaround:
The instructions I followed had me open VS code inside my ubuntu WLS2 instance. Note: my app is just a generic python app, not django.
If I click this and change it to open as a windows folder, then fun debug, everything suddenly works for me. (It spins up the docker and connects to it with debug, does breakpoints etc.)
I think what is happening for me is that "sometimes" docker is starting the container/app on its own WSL instance and my ubuntu instance cannot route to it for the debug.
I say sometimes, because sometimes it works. I think it might be related to which application (docker, ubuntu, vscode) I start first when I boot my machine.
I’ve messed with the docker, resources, WSL integration settings, the windows firewall, and restarted various things.
I’m sure a proper fix is not that complicated, however running VS code in native windows is enough of a fix for me. I don’t see why the added complexity of starting the VS code session inside WSL is actually necessary.
- [Django]-Why DateTimeField with auto_now_add can not get in form fields
- [Django]-Inserting utf8 characters in DB using Django
- [Django]-Backbone.js link file to model