[Twisted-web] questions about guard
federicotom at yahoo.it
Thu Apr 3 12:22:53 EDT 2008
i'm working on guard, having the following questions.
Questions are not specific to my problem. My hope is to understand some
1- suppose that, after the auth, the root resource R is associated to
the session. Suppose also that a child for the address /foo is defined.
Suppose I want to perform a logout when /foo/bar is requested.
How can I do it in PageFoo.locateChild() (without the need to redirect
to LOGOUT_AVATAR), returning a PageBar from there?
I mean something like that:
def locateChild(self, ctx, segs):
if segs == 'bar':
page_bar= static.File(somefile) # it's just an example
return page_bar, ()
2- Which is the best way to implement a realm so that:
- if you POST to /__login__ an auth is performed and a root resource
is assigned to the session
- if you GET /baz the url is processed and, depending on it, a page
Maybe it's sufficient to handle the Anonymous login, adapting it to
the second need (for anonymous, I associate a root resource which
will handle the /baz request)?
thanks in advance
Today is Pungenday, the 20th day of Discord in the YOLD 3174
More information about the Twisted-web