![](https://secure.gravatar.com/avatar/44e3f98a2f3b7213d5f14b558a849dd2.jpg?s=120&d=mm&r=g)
Pedro Sanchez wrote:
Hello,
I'm learning nevow and I would appreciate some help modifying this example:
http://nevowexamples.adytum.us/sources/guarded.py
This "logs in" a user validating it with a username and password. The form used to accept user input is embedded in the code using the stan tags in the NotLoggedIn() class. What I want is to have the login form in an external xhtml file (login.html), like the one that follows my signature. My new NotLoggedIn() class simply looks like this:
class NotLoggedIn(rend.Page): """The resource that is returned when you are not logged in""" addSlash = True docFactory = loaders.xmlfile("login.html")
I believe the only thing that has to change in the xhtml file (other than the nevow xml space declaration) is on the first line, the "action" thing (guard.LOGIN_AVATAR in guarded.py). But I can't figure out what nevow tag to use there.
Can you suggest how to do it?
There is no tag specifically for this. Instead, add a render directive to the <form> element in the HTML template and set the form action in the render_ method ... <form n:render="loginForm"> ... </form> def render_loginForm(self, ctx, data): return ctx.tag(action=url.root.child(guard.LOGIN_AVATAR)) - Matt -- __ / \__ Matt Goodall, Pollenation Internet Ltd \__/ \ w: http://www.pollenation.net __/ \__/ e: matt@pollenation.net / \__/ \ t: +44 (0)113 2252500 \__/ \__/ / \ Any views expressed are my own and do not necessarily \__/ reflect the views of my employer.