Hi All,
I' have made a simple application with web2py using the default layout, but 
i've a problem with redirect after login.
I want to redirect the user to /default/home after login, but i've some 
problem. I've tried all the solution proposed on this group with no luck.
db.py
# -*- coding: utf-8 -*-
db = DAL('sqlite://storage.sqlite')
from gluon.tools import Auth
auth = Auth(db)
auth.define_tables(username=True)
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = False
auth.settings.ieset_password_requires_verification = True
auth.settings.login_next = URL('home')

default.py

# -*- coding: utf-8 -*-
# this file is released under public domain and you can use without 
limitations

#########################################################################
## This is a sample controller
## - index is the default action of any application
## - user is required for authentication and authorization
## - download is for downloading files uploaded in the db (does streaming)
## - call exposes all registered services (none by default)
#########################################################################

from gluon.tools import Auth


def index():
    auth = Auth(db)
    auth.define_tables(username=False,signature=False)
    return dict(form=auth())

@auth.requires_login(otherwise=URL('index'))
def home():
    return dict(message=T('Ciao Mondo!'))


def user():
    """
    exposes:
    http://..../[app]/default/user/login
    http://..../[app]/default/user/logout
    http://..../[app]/default/user/register
    http://..../[app]/default/user/profile
    http://..../[app]/default/user/retrieve_password
    http://..../[app]/default/user/change_password
    http://..../[app]/default/user/manage_users (requires membership in
    use @auth.requires_login()
        @auth.requires_membership('group name')
        @auth.requires_permission('read','table name',record_id)
    to decorate functions that need access control
    """
    return dict(form=auth())


I've tried to edit layout.html :


<ul id="navbar" class="nav pull-right">{{='auth' in globals() and 
auth.navbar(mode="dropdown") or ''}}</ul>
# to
<ul id="navbar" class="nav pull-right">{{='auth' in globals() and 
auth.navbar(mode="dropdown",referrer_actions=None) or ''}}</ul>


But doesn't work.

I've also tried to modify the referrer {=auth.navbar(..., 
referrer_actions=['register', 'profile'])}} but doesn't work.

In the trace log i have this error:

Error ticket for "paynow"
Ticket ID

81.200.130.210.2014-08-07.23-08-14.11b8f438-981c-4749-84bf-a878ab14bbd6

<type 'exceptions.AttributeError'> 'NoneType' object has no attribute 
'replace'

Thanks a lot and sorry for disturb.

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to