In order to debug the server using PyCharm you need to do two things:
Prerequisites
1. Add a Python Interpreter
Within PyCharm go to Settings -> Project Interpreter -> Cogs symbol -> Add...
At the time of this writing there are multiple options, we will explain Docker Compose, because SSH Credentials don't work with Python 3.7.
2. Using Docker compose
Select Docker Compose and check the following values:
docker-compose.yml
at the root of your Phovea workspacepython
.3. Further actions
PyCharm should now be able to connect to the docker container and upload some helper files.
/phovea
<Project root> -> /phovea
Gevent compatible
PyQt compatible
1. Add a Python Interpreter
Within PyCharm go to Settings -> Project Interpreter -> Cogs symbol -> Add...
At the time of this writing there are multiple options, we will explain two of it: Docker Compose and SSH Credentials.
2a. Using Docker compose (recommended)
Select Docker Compose and check the following values:
docker-compose.yml
at the root of your Phovea workspacepython
.2b. Using SSH Credentials
Select SSH-Credentials and use the following values:
localhost
2222
root
docker
/usr/local/bin/python
NOTE: this is different from the default!3. Regardless of chosen option
PyCharm should now be able to connect to the docker container and upload some helper files. Regardless of which option you chose:
/phovea
<Project root> -> /phovea
Gevent compatible
PyQt compatible
PyCharm might have already created that one for you, otherwise:
phovea_server
\phovea\phovea_server\__main__.py
--env=dev api
\phovea
Add content roots to PYTHONPATH
and Add source roots to PYTHONPATH
Restart Docker with the debug mixin
./docker-compose-debug up
Restart Docker in the normal-mode to exit the debug-mode:
docker-compose up