I am using Django framework for my Python Web Application using Eclipse IDE and PyDev Plugin. How can I use the debugging features?
UPDATES1 particularly using http://pydev.org/updates plugin
UPDATES2 I already did the following:
.pydevproject
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>
<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Python25
</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.5
</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/pi-proto</path>
</pydev_pathproperty>
<pydev_pathproperty name="org.python.pydev.PROJECT_EXTERNAL_SOURCE_PATH">
<path>C:\Program Files\GeoDjango\Django-1.0.2-final</path>
<path>C:\eclipse-SDK-3.7-win32\plugins\org.python.pydev.debug_2.2.3.2011100616\pysrc
</path>
</pydev_pathproperty>
</pydev_project>
manage.py
#!/usr/bin/env python
from django.core.management import execute_manager
try:
import 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(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
if __name__ == "__main__":
import sys
if len(sys.argv) > 1:
command = sys.argv[1]
if settings.DEBUG and (command == "runserver" or command == "testserver"):
# Make pydev debugger works for auto reload.
try:
import pydevd
except ImportError:
sys.stderr.write("Error: " +
"You must add org.python.pydev.debug.pysrc to your PYTHONPATH.")
sys.exit(1)
from django.utils import autoreload
m = autoreload.main
def main(main_func, args=None, kwargs=None):
import os
if os.environ.get("RUN_MAIN") == "true":
def pydevdDecorator(func):
def wrap(*args, **kws):
pydevd.settrace(suspend=False)
return func(*args, **kws)
return wrap
main_func = pydevdDecorator(main_func)
return m(main_func, args, kwargs)
autoreload.main = main
execute_manager(settings)
Run Configurations - Arguments
runserver 0.0.0.0:8001
UPDATES3 I am following this link http://bear330.wordpress.com/2007/10/30/how-to-debug-django-web-application-with-autoreload/
But no success. Would you guide me on how to correctly follow the above link..Then I will update the result here.
UPDATES4 I am using Python 2.5.2, GeoDjango 1.2.7, Eclipse Indigo with PyDev Plugin.