Auth assumes the login actions are available at /default/user. If you change that, you have to tell Auth. The easiest way is upon initialization:
auth = Auth(db, controller='pkg', function='my_user_function') Alternatively, you can subsequently change settings such as auth.settings.controller and auth.settings.function, but then you also have to change a number of settings that are based on those values, such as auth.settings.login_url, auth.settings.logged_url, etc. So, it is easiest to specify the controller and function when initially constructing the Auth object. Note, you will also have to move the /views/default/user.html view to /views/pkg/user.html (and change "user.html" to match the name of your new user action if you have changed that). Anthony On Friday, April 17, 2015 at 10:50:37 PM UTC-4, Tom Stratton wrote: > > Hi - > > I wanted to change my default application and did some research. > > First I did the simple: > ``` > default_application='p' > default_controller = "pkg" > default_function = "packages" > ``` > And it seemed to work fine but I was not satisfied so I did this: > ``` > routers = dict( > BASE = dict(default_application='p', default_controller='pkg'), > ) > ``` > > This seemed to work fine too - BUT… Then my login session expired and I > see this URL: > https://bsttemp.pythonanywhere.com/default/user/login?_next=/packages > > How can I make the login happen at my "preferred" controller instead of in > the default one? (I had deleted the default.py controller after my limited > testing worked) > > Thanks > > Tom > -- 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.

