[Twisted-Python] guard.UsernamePasswordWrapper errback

Justin Johnson justinjohnson at fastmail.fm
Thu Oct 9 13:10:30 EDT 2003

I got a woven login page working by copying
Twisted/sandbox/glyph/dynademo where guard.UsernamePasswordWrapper is
used.  In the dynademo example, if the password is entered incorrectly,
an error page displays as documented in the doc strings for
UsernamePasswordWrapper.  The problem is that it displays the error on a
new page.  I'd like to capture the error in an existing html file.  So I
added the errback argument as follows:

r = guard.SessionWrapper(guard.UsernamePasswordWrapper(p,
callback=dumbRedirect, errback=dumbRedirect))

This redirects me back to the main page.  Is there some sort of view or
model available signaling that an error occurred, which I could put in my
main page?  Something like:

<div view="login_error"/>

Is there a better way to do this?


More information about the Twisted-Python mailing list