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.


Before you are able to use eric3 to debug mod_python modules you have to patch the mod_python installation. In order to do this, simply run the script patch_modpython.py contained in the eric3 distribution. This changes the file apache.py of mod_python to use the eric3 debugger instead of Pdb.

Quick Start

Example

.htaccess

AddHandler python-program .py
PythonHandler modpython_dbg
PythonDebug On
PythonEnablePdb On

modpython_dbg.py

from mod_python import apache

apache.initDebugger('/Path/To/modpython_dbg.py')

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

    return apache.OK