This repository has been archived by the owner on Jun 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
PyCharm debugging
Holger Stitz edited this page Nov 3, 2017
·
1 revision
In order to debug the server using PyCharm you need to do two things:
Restart Docker with the debug mixin
./docker-compose-debug up
Restart Docker in the normal-mode to exit the debug-mode:
docker-compose up
- Within PyCharm go to Settings -> Project Interpreter -> Cogs symbol -> Add Remote...
- Select SSH-Credentials and use the following values:
- Host:
localhost
- Port:
2222
- User name:
root
- Password:
docker
- Python interpreter path:
/usr/local/bin/python
NOTE: this is different from the default!
- PyCharm should now be able to connect to the docker container and upload some helper files
- Create default path mappings
- Select project directory and specify it is located at
/phovea
- In the end the overview page should state:
<Project root> -> /phovea
- Gevent compatible Python debugging
- Go to Build, Execution, Deployment -> Python Debugger
- Check
Gevent compatible
- Uncheck
PyQt compatible
- Apply changes -> Close settings dialog
- Run -> Edit Configurations
- In the dialog Plus sign (top-left) -> Python
- Name:
phovea_server
- Script:
\phovea\phovea_server\__main__.py
- Script parameters:
--env=dev api
- Python interpreter: Remote Python (created above)
- Working directory:
\phovea
- Uncheck
Add content roots to PYTHONPATH
andAdd source roots to PYTHONPATH
- Apply and close the dialog
- Start Docker using the debug mixin
- Set a breakpoint next to the line number in a Python file
- Run -> Debug -> phovea_server
- Open the URL in the browser that triggers the breakpoint
- Debug the Python in the PyCharm panel