tags:

views:

11

answers:

0

Hi,

I'm trying to learn about using mod-wsgi, and I thought the best way would be for me to write my own simple 'debug' framework. I am NOT looking to use someone else's debug framework at this time.

The problem is, I'm not sure how to get started.

Specifically, I have a script working now where there is a WSGIAlias to my python script:

/testscript -> /home/bill/testscript.py [this works ok]

There are several annoying problems here, namely that if there is any syntax error of any kind, apache returns a 500 server error, and I have to check the server logs, which is annoying.

What I would like to do is to have some kind of framework called, that then encapsulates my script, this way when an error occurs (like a syntax error in testscript.py or any other type of exception), I can catch the exception, and return a nicely formatted HTML file with debugging information.

My question is, how do I 'pass' the script I want to run as an argument to my debug script?

From the command line, it would be easy, I would do something like this:

$ python debug.py myscript.py

How can I do this using WSGI though? Any ideas?