Disable autoreload to allow single thread debugging

1,700 views
Skip to first unread message

magic

unread,
Jun 27, 2006, 1:19:35 AM6/27/06
to Django users
To debug using pydev in eclipse the django server needs to run in a
single thread. However django/core/management.py autoreloads main to
run in another thread or process.

django/core/management.py (line 1013)

from django.utils import autoreload
autoreload.main(inner_run)

I believe there should be a way to tell the django to run in a single
thread for debug purposes. Something like this would suffice.

if os.environ.get("PYDEV_DEBUG") == "true":
inner_run()
else:
from django.utils import autoreload
autoreload.main(inner_run)

Have other users had this issue. Can we get this fix added to the trunk
development.

gjiro

unread,
Jul 17, 2006, 7:58:14 PM7/17/06
to Django users
Hi,

Changeset 3348, adds the '--noreload' option for django_admin.py.

"Added command line flag to disable use of auto-reloader on development
server."

Check http://code.djangoproject.com/changeset/3348

gjiro

mrstone

unread,
Aug 15, 2006, 11:57:50 AM8/15/06
to Django users
If you running Eclipse with PyDev you can create a file
'debugServer.py' with the following content:


import os
os.environ['DJANGO_SETTINGS_MODULE']='mysite.settings'
from django.core import management
management.runserver(addr='0.0.0.0', port='8080', use_reloader=False)


Then set up Eclipse to run/debug with that file and you can set
breakpoint etc right thru the hole process

Regards
Sten

Reply all
Reply to author
Forward
0 new messages