Developing and debugging local with Docker #5404
Replies: 2 comments 1 reply
-
Using docker for local development solves the I'm not a VSCode user myself but they provide docs about this topic that uses django as an example: https://code.visualstudio.com/docs/containers/debug-python can you give that a try? |
Beta Was this translation helpful? Give feedback.
-
Thanks @foarsitter. I'm trying to work through those docs and others...still various pieces I'm trying to synthesize. This issue mentions devcontainer.json, which seems to indicate best practice is to set up VS Code server inside a container? Not clear how one attaches to the running the Django app from this attached VS Code such that it respects breakpoints and can be debugged... Tips from anyone who's got this working? |
Beta Was this translation helpful? Give feedback.
-
Hi all. I'm wading into the Docker-based approach to local dev, as it seems like the general consensus is the extra complexity pays off in the long run for deployments, consistency, etc.
However, I can't find much info on the latest best-practice to setting up VS Code to launch and debug the Django app (or Celery process). I see some similar questions in the posts on this forum seeking similar info, and have found some dated tutorials that only somewhat apply.
Does anyone have pointers to a good resource that addresses debugging a Django project produced by Cookie cutter in a Docker configuration via VS Code?
The official docs page on this topic doesn't provide much info here, just a brief mention of ipdb (which I don't think is involved here).
I see that a .devcontainer folder is added during generation if one indicates they're using Docker and VS Code, (via #4198) but it's unclear to me how to leverage this in actual use. If I understand it correctly, these files help you set up a new VS Code within the running container itself? Is that the best way of debugging Django running in Docker?
It may be that running Django in docker locally isn't worth the extra complexity except for certain situations where you need exact parity with production environments. Would love to hear any thoughts on your own experience.
Thanks for any suggestions or pointers to extra info!
Beta Was this translation helpful? Give feedback.
All reactions