'What's the best way to add ipdb.set_trace() in a python library in a docker container?

I'm currently debugging a Django application and need to add ipdb.set_trace() to set a debug break point in one of the admin classes. The Django library is built into a virtualenv directory inside the container image, so I can't edit it directly without getting a shell to the container, installing vim, etc.

Is there an easier way? I thought of using a volume, but I'm not sure how to do a "reverse" volume, where the host uses the files in the container, and not vice-versa.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source