[mod_python] Debugging mod_python

Martijn Moeling martijn at xs4us.nu
Sun Jul 30 11:49:45 EDT 2006


Hi Graham,

The apache errorlog is indeed usefull, the manual start of httpd is an
option indeed, but for my setup a bit useless. I have build a sort of
replacement for my handler that creates the request object which can be
run in idle and the objects content is created by editing the source, it
is to raw to publish but has proven to be an useful option.

By now I have implemented a windows interface within a browser using
javascript and are using mod_python to interface to the XMLHttpRequest
object, debugging that, with sessions have been proven troublesome.

The whole system I have now would be a perfect base for a python IDE
within a browser, but there are still some hills to climb since I do it
all on my own, I will go public source with this system eventually but
for now the system is a bit to purpose specific.

The goal for now is to provide a back office for politicians, where they
maintain their own website by using the system to do their work and it
will provide a way to communicate with the citizens, all without the
need of software installation, working on any internet connected
computer. A huge job which is subsidized and solely relies on open
source software, made even more difficult since I never did any project
like this before. I have a huge professional programming experience
though.
 
At the moment I am trying to find a way to "load" code from a mysql
database on demand without saving it, the best would be to have the code
persistant and write a algorithm around it to load and reload it on
demand globally, basically what mod_python does with its reload
possibilities of handler source code, but than at module level. I still
seem unsure about the interpreter count and how the number of apache
processes and threads are influencing the performance of the webserver
in total, this makes it more difficult to search for a solution.


Martijn
-----Oorspronkelijk bericht-----
Van: Graham Dumpleton [mailto:grahamd at dscpl.com.au] 
Verzonden: Sunday, July 30, 2006 14:06
Aan: Martijn Moeling
CC: mod_python at modpython.org
Onderwerp: Re: [mod_python] Debugging mod_python


On 30/07/2006, at 9:22 PM, Martijn Moeling wrote:

> Hi,
>
>
>
> I have been developing with mod_python for over a year now
>
> I do like the python language, but with mod_python I miss the tools
>
> For proper debugging. I know the difficulties but maybe there are  
> some tools
>
> Around I could not find. Is there any best practice?
Do you know about and use the PythonEnablePdb directive? You do need
to be able to run "httpd" manually with '-X -DONE_PROCESS' command line
options, but in worst case scenario it is sometimes useful.

Besides that, I personally just tend to use apache.log_error() a lot.  
Some times
I go to the extent of adding log messages into C code of mod_python,  
but then
I am working with the same low level C code a lot to fix issues or  
add new features
to mod_python itself. :-)

Graham



More information about the Mod_python mailing list