Using Wing IDE with mod_wsgi
Wing IDE is an integrated development environment that can be used to write, test, and debug Python code that is running under mod_wsgi and other Python-based web development technologies. Wing provides auto-completion, call tips, a powerful debugger, and many other features that help you write, navigate, and understand Python code.
To get started using Wing, refer to the tutorial in the Help menu in Wing and/or the Wing IDE Quickstart Guide.
When debugging Python code running under mod_wsgi, the debug process is initiated from outside of Wing IDE, and must connect to the IDE. This is done with wingdbstub according to the instructions in the Debugging Externally Launched Code section of the manual.
Because of how mod_wsqi sets up the interpreter, be sure to set kEmbedded=1 in your copy of wingdbstub.py and use the debugger API to reset the debugger and connection as follows:
import wingdbstub wingdbstub.Ensure()
Then click on the bug icon in lower left of Wing's window and make sure that Accept Debug Connections is checked. After that, you should be able to reach breakpoints by loading pages in your browser.
Disabling stdin/stdout Restrictions
In order to debug, may also need to disable the WSGI restrictions on stdin/stdout with the following mod_wsgi configuration directives:
WSGIRestrictStdin Off WSGIRestrictStdout Off
Wing IDE provides many other options and tools. For more information: