Try ERPNext Buy Support Partners Foundation

Instructions on how to debug in pycharm - Verified with latest pycharm pro

Hi there, I was attempting use pycharm to debug, and a lot of the stuff on the forums didn’t work.

Here is instructions that worked for me:

  1. Get frappe bench setup and your site up and running on port 8000

  2. Open the frappe project from apps/frappe in pycharm

  3. Open the erpnext project from apps/erpnext, and add to existing project.

  4. Go to file Project dependencies, and make each project dpending on each other

  5. Set up a new python interpreter environment, and choose the existing venv that bench is using

  6. Set up a new configuration under run/debug and set up as appropriate (running on port 8001, since 8000 is still being used by bench), using the interpreter you set up previously

Now start up in debug mode
visit your site:8001
and your breakpoints will be hit in either frappe or erpnext.

Caveats I’ve found so far:
cant debug python rq jobs
socketio doesnt work, since its running on port 8000, but it tries looking for it on port 8001.

Feel free to let me know any feedback.


Just to add to this I found the following:

It has a better way to do it by stopping bench serve from running, so that then pycharm could run on port 8000. This would then allow socketio etc to all keep working.

Just put the link in here so that it doesn’t get lost - The wiki on frappe github has some gems.

1 Like

Yes, i can confirm that this works, after trying different suggestion from different links. here is my screenshot, below

1 Like