[wingide-users] django debugging

Wingware Support support at wingware.com
Tue May 29 10:04:10 MDT 2007


VL wrote:
> I saw in the archives there have been a few posts about debugging using 
> wing and django, but looks like the poster either got it working or stop 
> trying.  I am using apache and mod_python and Django so I thought the 
> mod_python example(http://wingware.com/doc/howtos/mod_python) may work.  
> I've been struggling with it for a couple days on and off and no 
> debugging so far.  Has anyone had any luck with this configuration or 
> something like it?

I've attached below text in the minimal Django how-to that I derived
from that user's experience.  It may help, although you're in somewhat
uncharted territory in that you're also using mod_python and the how-to
you reference was written for Wing 2.x and the Django how-to is for
Wing 3.x (and won't work with Wing 2.x, since it lacks threading
support).  You definitely need to use Wing 3.x for Django, unless
you can get it to run with only one thread.

You may want to get things working first w/o mod_python and then
try to add mod_python.  Otherwise, I could see it would get
confusing.

If you solve the problem and have some tips to add to the Django
how-to, please send them to me and I can merge them in.  Also,
feel free to email support at wingware.com with details of whatever
you run into and we can try to help.

Thanks,

- Stephan

-------------------------------

Using Wing IDE with Django
--------------------------

`Wing IDE`__ is an integrated development environment for the Python
programming language. Wing can be used to speed up the process of writing and
debugging code that is written for Django__, a powerful web development
system.

__ http://wingware.com/wingide/
__ http://www.djangoproject.com/

In order to debug Django applications, you will need Wing 3.0 or later,
since earlier versions did not support multi-threaded debugging.

**Note:** This document is a draft that contains information obtained from
users of Wing IDE.  Its accuracy has not yet been verified by Wingware.

Installing Django
---------------------

The `Django website`__ provides complete instructions for installing Django.

__ http://www.djangoproject.com/

Configuring Django to use Wing
------------------------------

By default, Django runs in an environment that spawns and automatically relaunches
a sub-process for servicing web requests.  This is used to automatically restart
the server if for some reason it crashes.  However, this does not work with Wing's
debugger since the debugger has no way to cause the sub-process to be debugged
when it is started by the main process.

Recent versions of Django if obtained from Subversion include a ``--noreload`` option
that you can pass to the ``manage.py`` or ``django-admin.py`` scripts to turn off the
auto restart feature of Django.

The typical way to do this is to set the ``manage.py`` file as the primary debug
file in Wing and give it the following Run Arguments via the debug properties tab
in the File Properties dialog::

   runserver --noreload

Other options can be added here as necessary for your application.

In older versions of Django, this option does not exist.  The only way to solve
the problem there is to make a modification to the code to prevent launching
of a sub-process.

Related Documents
-----------------

Wing IDE provides many other options and tools.  For more information:

* `Wing IDE Reference Manual`__, which describes Wing IDE in detail.

* `Django home page`__, which provides links to documentation.

* `Wing IDE Quickstart Guide`__ which contains additional basic information about
   getting started with Wing IDE.

__ ref:manual
__ http://www.djangoproject.com/
__ ref:howtos/quickstart


More information about the wingide-users mailing list