Introduction

eric3 is an integrated development environment for the Python programming language. It can be used to debug code that is run by the mod_python module for the Apache web server. This document assumes mod_python is installed and Apache is configured to use it; please see the installation chapter of the mod_python manual for information on how to install it.


Since eric3's debugger support is single threaded, only one http request can be debugged at a time. A new debugging session is created for each request and the session is ended when the request processing ends. This is true of requests processed by a single Python module and it is true of requests processed by multiple Python modules in the same Apache process and its child processes. It is recommended that only one person debug mod_python based modules per Apache instance. Further on it is recommended to restart the Apache server after a debugging run because sometimes the socket connection to the IDE hangs on a later run. If you see a message in the „stdout“-window telling that a passive debugging connection was received, but nothing more happens, the socket connection is blocked and it is time to restart the Apache.

Quick Start

Example

from mod_python import apache

import eric3dbgstub

def handler(req):
    if eric3dbgstub.debugger is not None:
        eric3dbgstub.debugger.startDebugger('/Path/To/modpython_dbg.py')

    req.content_type = "text/plain"
    req.send_http_header()
    req.write("Hello World!\n")

    return apache.OK