This is a great question! I forget how IDEs have nice features like breakpoints. OK so let's assume you have already started your services via something like docker-compose up
. Let's also assume you have already opened your project in PyCharm.
The next thing to do is to configure a remote interpreter for the project as described in the PyCharm documentation.
OK, this next bit is this interesting part. When you add a Run/Debug configuration, let's say you have a Flask application, add a Flask server
. When you do this, you'll see the Python interpreter
is the remote interpreter! Cool!
One note - because of this issue pipenv
does not work for a remote interpreter. Use pip
instead.