Debugging local Django app outside server root

84 views
Skip to first unread message

Elliott

unread,
Oct 18, 2014, 11:52:47 PM10/18/14
to django...@googlegroups.com
Is it possible to debug (e.g. stop on breakpoints) an external Django app when running a Django server in a VM via remote debugging in Pycharm? I am able to run and debug the Django server using PyCharm's remote debugger, and the app runs as expected (changes to the local source code are reflected immediately in the server responses), but I cannot debug the app in the same PyCharm instance running the server.

My directory structure:

django-app/ setup.py ... (code) django-server/ manage.py ... (code)

In my requirements file I'm loading the django-app in 'editable' mode:

-e /django-app

I have tried:

  • opening the django-server as the project root and then adding django-app as a new project in the same window, and,
  • opening the shared root directory as the project root and setting django-server/ as the source root & working dir for the server.

In both cases, when I run the server in debug mode, I see the following message if I have any breakpoints set in the django-app:

pydev debugger: warning: trying to add breakpoint to file that does not exist: ... (local path that looks correct)

I would appreciate any ideas as to how to properly step through the django-app component, thanks!

Elliott

unread,
Oct 20, 2014, 2:16:44 PM10/20/14
to django...@googlegroups.com
Update:

The django app and the django server are both using the same Python interpreter.

If I try to set a breakpoint in the app, the breakpoint does not exist warning actually is a local file but is in the remote_sources cache:

Connected to pydev debugger (build 135.1057)
pydev
debugger: warning: trying to add breakpoint to file that does not exist: /Users/.../Library/Caches/PyCharm30/remote_sources/-1170959507/django-app/example.py (will have no effect)

Reply all
Reply to author
Forward
0 new messages