[mod_python] Session Classes and Documentation

SAiello at Jentoo.com SAiello at Jentoo.com
Thu Mar 4 07:31:57 EST 2004


I am just starting to try mod_python. I read the 3.1 documentation on the web 
site, chapter 4.8.1 on Classes. Reading the info on "class MemorySession" & 
"class DbmSession", both paragraphs say, "Note that using this class directly 
is not cross-platform. For best compatibility across platforms, always use 
the Session() function to create sessions.". When I just use, "sess = 
Session(req)", I get the following error:

Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 299, in 
HandlerDispatch
result = object(req)

File "/usr/lib/python2.3/site-packages/mod_python/publisher.py", line 136, in 
handler
    result = util.apply_fs_data(object, req.form, req=req)

File "/usr/lib/python2.3/site-packages/mod_python/util.py", line 361, in 
apply_fs_data
return object(**args)

File "/var/www/localhost/htdocs/python/test.py", line 5, in hello
sess = Session(req)

TypeError: 'module' object is not callable

But if I use either "sess=Session.DbmSession(req)" or 
"sess=Session.MemorySession(req)", everything works. Please advise.

Thanks,


More information about the Mod_python mailing list