Hey All,
      I got it working with the below code -

If you need to redirect to a url - after Auth login -

In your controller - (default.py) - Just add the below function and
call it with "auth.settings.login_onaccept" as shown below.
#------------------
def afterlogin(form):
    redirect("http://127.0.0.1:8000/ProjecName/default/main";)

auth.settings.login_onaccept = lambda form:afterlogin(form)

def main():
    #response.view='default/main.html'
    return dict()
#----------------------------
Note:
1. You should have main.html and its corresponding function in default
controller. i.e. Where you would like to direct the file
2. You do not need to add anything for this in db.py Just these 3
lines should make it work . It works for me.

Thanks All,

Cheers, Rahul D
(www.flockbird.com   - powered by web2py)

PS: We can close this thread!


On Nov 11, 4:09 pm, Cahya Dewanta <[email protected]> wrote:
> 1. in your db.py you should define
>
> def go_log(object):
>     redirect(URL('default','samples'))  #default is the controller,
> samples is the action.
>
> auth.settings.login_onaccept = go_log
>
> 2. in your default.py create a action
>
> def samples():
>     return dict()
>
> 3. you should have created file samples.html in your views/default dir
>
> tables are models. you create them when you call db.define_table()

Reply via email to