*By default, after a successful login the page directs to "default/index". 
I want it to redirect to some other page.*

This my controller code "user.py"

def login():
    form=auth.login()
    if form.process().accepted:
        redirect(URL('page_1'))
    return dict(form=form)

This is the view code for "user/login":

<!DOCTYPE html><html lang="en"><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title></head><body>
    <div class="container">
        
        <div class="form-container">
     {{=form.custom.begin}}


            <input type="text" name="email" placeholder="email id" 
class="string" id="auth_user_email" value="" />

        <input placeholder="Password" name="password" class="password" 
id="auth_user_password" type="password" class="field" value="" />
            <div class="wrap">
                <input name="submit" type="submit" class="btn" 
value="{{=T('Login')}}" />
                <input name="sign_up" class="btn" type="submit" 
formaction='/{{=request.application}}/default/user/register' value="{{=T('Sign 
Up')}}"/>
            </div>
            <input name="Forgot Password" type="submit" class="btn" 
value="{{=T('Forgot Password')}}" 
formaction='/{{=request.application}}/default/user/retrieve_password' />
            {{=form.custom.end}}
        </div>
    </div>
    </body></html>

*The thing is, when the form is getting processed, it is still redirecting to 
the page "default/index". I don't know where to change this default setting in 
the application. The code of my controller is not working properly.*

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/1fb9ce4f-bc0b-40d6-adb2-68eee5d84dbeo%40googlegroups.com.

Reply via email to