The debugger attaches specifically to the web service. env.dev depends_on : - db db : image : postgres:12.0-alpine volumes : - postgres_data:/var/lib/postgresql/data/ environment : - POSTGRES_USER=hello_django - POSTGRES_PASSWORD=hello_django - POSTGRES_DB=hello_django_dev volumes : postgres_data : app command : python manage.py runserver 0.0.0.0:8000 volumes :. The "Configuration file(s)" field should point to your Docker Compose file while the "Service" field should point to the web application service from your Docker Compose file.įor example, if your Docker Compose file looks like this, then you'll want to point to the web service: In the next dialog, choose "Docker Compose" in the left pane, and select the Docker configuration you created in the previous steps in the "Server" field. Assuming you have a project open, open the settings once again and expand the "Project: " setting and click "Python Interpreter". Now that we have the Docker configuration set up, it's time to configure Docker Compose as a remote interpreter.
Click "Docker" and then click the "+" button to create a new Docker configuration.įor Mac, select the Docker for Mac options. To do so, open P圜harm settings ( P圜harm > Preferences for Mac users or File > Settings for Windows and Linux users), and then expand the "Build, Execution, Deployment" setting.
#PYCHARM TUTORIAL HOW TO#
The first step we need to do is to tell P圜harm how to connect to Docker.