I am trying to run on a remote server the cookbook sample of session +
debug:
and getting an error which suggests that the session object is empty.
I am using the latest git cloned revision
On my machine it works fine
The only difference between this two environments is that on the
remote machine, version 0.3 is not installed but located in the
code.py directory.
Everything works that way, except the session feature.
(I cannot install web.py 0.23 until I will migrate existing web.py +
infogami applications)
Could it be that it has something to do with the install-less mode?
# The error:
80.74.97.189:33645 - - [25/Nov/2008 14:58:19] "HTTP/1.1 GET /" - 500
Internal Server Error
session <Storage {}>
Traceback (most recent call last):
File "/opt/galigeva.com/site/web/application.py", line 194, in
process
return self.handle()
File "/opt/galigeva.com/site/web/application.py", line 184, in
handle
return self._delegate(fn, self.fvars, args)
File "/opt/galigeva.com/site/web/application.py", line 365, in
_delegate
return handle_class(cls)
File "/opt/galigeva.com/site/web/application.py", line 340, in
handle_class
return tocall(*args)
File "/opt/galigeva.com/site/test.py", line 15, in GET
session.count += 1
File "/opt/galigeva.com/site/web/utils.py", line 830, in __getattr__
return getattr(self._getd(), key)
File "/opt/galigeva.com/site/web/utils.py", line 64, in __getattr__
raise AttributeError, k
AttributeError: 'count'
# The cookbook sample
import web
urls = ("/", "hello")
app = web.application(urls, globals())
if web.config.get('_session') is None:
session = web.session.Session(app, web.session.DiskStore
('sessions'), {'count': 0})
web.config._session = session
else:
session = web.config._session
class hello:
def GET(self):
print 'session', session
session.count += 1
return 'Hello, %s!' % session.count
if __name__ == "__main__":
app.run()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---