[mod_python] servlet

Daniel Popowich dpopowich at comcast.net
Fri Jul 30 14:43:25 EDT 2004

> firt af all some little problem:
> 1) If I leave in httpd.conf "ServerName localew.manord.com" when I start the
> tutorial an alert tell me that:localew.manord.com can't be found, with this
> statement comment all work fine

Does this address resolve via DNS otherwise?

> 2)with the tutorial folder under DocumentRoot all work fine:
> <Directory D:/discoE/wwwroot/cartelle_sito_mdn/mps_progetti/tutorial>
>       SetHandler mod_python
>       PythonHandler mod_python.servlet
>       PythonDebug on
>     </Directory>
> but all my script don't stay under DocumentRoot, and with Alias statement I
> can see them, but with servlet :
> Alias /tutorial/ "D:/discoE/script/cgi/tutorial/"
> <Directory "D:/discoE/script/cgi/tutorial">
>       SetHandler mod_python
>       PythonHandler mod_python.servlet
>       PythonDebug on
>  </Directory>
> Forbidden You don't have permission to access /tutorial/ on this server

Does the apache process have access to this physical directory?

> 3) this is only for confirm:
> I already have a Session instance from publischer program, and the function
> made a lot of other work..
> So in order to use my function on servlet a workaround may be:
> class willybase(HTMLPage):
>     py = {}
>     use_session = False   <------------------------
>     def prep(self):
>         HTMLPage.prep(self) 
>         self.session = adatta_ha.sessione(self.req,....) <--------
>         self.use_session=True   <------------
>         ........
> In this way cleanup_session etc.. I think will work fine, and I have the
> same function called from publisher and servlet
> I'm right?

Should be fine.  In fact, a feature I'm considering for the next
verion is that use_session can refer to the class to instantiate for
session management.  In this way one could sublass
mod_python.Session.Session or create a class that implements the same

Hope this helps!


More information about the Mod_python mailing list