i have windows computer running vagrant ubuntu virtual machine. ubuntu virtual machine has flask app running on apache mod_wsgi. i've setup pycharm use vagrant remote python interpreter.
i can debug script fine can't seem find way debug actual flask app running.
vagrant has code folder shared , forwards port 80 => 8080
i can access flask app in chrome going 127.0.0.1:8080 in windows.
i've tried follow pycharm guide copying pyhton-debug.egg , adding following init.py file
if __name__ =='__main__': app.run(host='0.0.0.0', port=80, threaded=true) import sys sys.path.append('/home/vagrant/code/flask-app/pycharm-debug.egg') import pydevd pydevd.settrace('0.0.0.0', port=8080, stdouttoserver=true, stderrtoserver=true)
for reason import pydevd didn't seem work used easy_install install egg , seems ok.
i had change ip address ip address virtual machine windows machine , use these settings in debug configuration.
so init.py file has
import pydevd pydevd.settrace('10.0.2.2', port=80, stdouttoserver=true, stderrtoserver=true)
Comments
Post a Comment