[Twisted-web] Sessions with LivePage?

Chris (FeedTagger) chris.were at gmail.com
Fri Jul 22 01:38:56 MDT 2005


Hi,
I'm having an issue with sessions and livepage - I can't seem to get
the two working together. If I replace livepage.LivePage with
rend.Page the session works as expected... I keep refreshing and the
same uid appears. Why is this not the case with LivePage and how can I
use sessions? Neither of the examples; chatola and liveanimal use
sessions with livepage.

Thanks in advance,
Chris

-----

from nevow import rend, loaders, appserver
from nevow import tags as T
from nevow import inevow, static
from nevow import livepage


class Page(livepage.LivePage):
#class Page(rend.Page):
    addSlash = True
    docFactory = loaders.xmlfile('core.xhtml')
    
    def __init__(self):
        print '*'*22
        livepage.LivePage.__init__(self)
    
    def child_search(self,ctx):
        return SearchPage()
        
    def render_body(self, ctx, data):
        session = inevow.ISession(ctx)
        ctx.fillSlots('a_slot',session.uid)
        return ctx.tag
        
        
class SearchPage(livepage.LivePage):
    pass
    
from twisted.application import service, internet
application = service.Application("liveweb")
internet.TCPServer(8080,
appserver.NevowSite(Page())).setServiceParent(application)



More information about the Twisted-web mailing list