This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Somewhere in our Django stack gevent was being invoked and monkey patching socket and threads. | |
# PTVSD uses low-level sockets + a thread to work, and the monkey patched version (even if you | |
# call gevent.monkey.patch_all()) somehow was not working correctly. | |
# By reloading those modules, you can get the debugger to work correct and step through your code. | |
import ptvsd, socket, thread, threading | |
reload(socket) | |
reload(thread) | |
reload(threading) | |
ptvsd.enable_attach("my_secret", address = ('0.0.0.0', 3000)) | |
ptvsd.wait_for_attach() |
OlderNewer