Can't debug django app

Hello.

I can't find answer on this forums, so i hope i didn't overlooked the answer.
In my Django manage.py i have:
#!/usr/bin/env python

import socket
from pydev import pydevd
print 'connecting to debug server'
pydevd.settrace('192.168.1.159', port=22000, stdoutToServer=True, stderrToServer=True, suspend=False)
print 'connected to debug server'


from django.core.management import execute_manager
import imp
try:
    imp.find_module('settings') # Assumed to be in the same directory.
except ImportError:
    import sys
    sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n" % __file__)
    sys.exit(1)

import settings

if __name__ == "__main__":
    execute_manager(settings)


When I start debug server in PyCharm manage.py gets connected to it:
Waiting for connection...
Starting debug server at port 22000
Connected to pydev debugger (build 121.224)
connected to debug server

But it just stops there. Django debug "runserver" doesn’t even start. In my Linux shell I notice that manage.py tries to connect twice to debug server. This is output from shell:
/home/WebVoip/manage.py runserver 0.0.0.0:80 –adminmedia=/home/WebVoip/templates/media/
connecting to debug server
connected to debug server
connecting to debug server

I have no breakpoints enabled. What am I doing wrong?
Thank you.
2 comments
Comment actions Permalink
Hi Uroš,
could you please also disable exception breakpoints and try one more time (Run | View Breakpoints -> Python Exception Breakpoints ).

If it doesn't help. Please add environment variable PYCHARM_DEBUG = True to your run configuration, press debug and provide console output.
0
Comment actions Permalink
Hello.

Thank you for your answer. I solved this with –noreload.
0

Please sign in to leave a comment.