Zhang Hua posted: 2014-01-17
Copyright notice: Can be reproduced arbitrarily, please be sure to use hyperlinks in the form of the original source of the article and the author's information and this copyright notice (http://blog.csdn.net/quqi99)
1, for the WSGI web app to be debugged remotely, add the following code, where 172.16.1.122 is the IP address of the remote installation of the Eclipse machine.
Import PYDEVD
Pydevd.settrace (' 172.16.1.122 ', 1234, Stdouttoserver=false, Stderrtoserver=false)
If you use Monkey_patch, remember to set thread to Flase, Eventlet.monkey_patch (Os=false, Thread=false)
For example, if we want to debug Nova-compute, we can start the service as follows, it will automatically do as above set
Nova-compute--remote_debug-host 172.16.1.122--remote_debug-port 1234
2, Eclipse end, set environment variables first
Import Sys
Sys.path.append ('/bak/java/eclipse/plugins/org.python.pydev_3.1.0.201312121632/pysrc/')
Or:
Export pythonpath=/bak/java/eclipse/plugins/org.python.pydev_3.1.0.201312121632/pysrc/: $PYTHONPATH
or add a external Libraries in the Pydev-pythonpath of the properties of the Eclipse engineering point right-hand side, either way.
3,eclipse side, next to ensure that the eclipse side also has the same code, if in different directories, you can use modify/bak/java/eclipse/plugins/org.python.pydev_3.1.0.201312121632/ pysrc/pydevd_file_utils.py file:
Paths_from_eclipse_to_python = [(R '/bak/openstack ', R '/server_side/openstack ')]
4, after starting the remote Nova-compute service (after Pydevd.settrace), in the local eclipse into the "Debug" view will see a "Pydev:start the PyDev Server" button and then click on it, At this point eclipse is connected to the remote.
The rest of the set breakpoint set breakpoint, usually what to do on the How to do.
Reference:
Http://pydev.org/manual_adv_remote_debugger.html
Transferred from: http://blog.csdn.net/quqi99/article/details/18404807