[mod_python] Having problems getting mod_python working.

Gregory (Grisha) Trubetskoy grisha at modpython.org
Sun May 9 15:02:51 EST 2004

On Sun, 9 May 2004, Jay Donnell wrote:

> But, the form.py example won't work if I send it fewer arguments than
> it expects. For example, I can't call form.py/email without passing it
> any post variables. I get the following
> TypeError: email() takes exactly 4 non-keyword arguments (1 given)

Which is normal Python behaviour. If you want your arguments to appear as
"optional" you need to assign default values to them, e.g.:

def myfunc(required, optional=None):


In the above line 'required' is required, but 'optional' is optional as it
will default to None.

> Also, the documentation was very confusing. I had to use part of the
> example from the 2.7 doc (AddHandler python-program instead of
> AddHandler mod_python .py) and part from the 3.1 doc
> (action="form.py/email" instead of action="form/email"). I'm using
> version 3.0.1 which was the latest rpm available to me via yum.

Do you mean to say that the 3.0.1 docs are incorrect for the version
3.0.1, but this has been corrected in 3.1, or is there still a problem?



More information about the Mod_python mailing list