python - Load a different view when logged in -
If I'm trying to learn Python + web2py, then I have to load the index page a different view, depending on whether you 're logged in or not according to my understanding of MVC it will be on the controller. Now I've seen the authentication of web2py, but can not really detect it.
And whether it is in the controlling side or better elsewhere?
You can specify a different view in the controller:
Diff index (): if auth user: response.view = 'default / index_logged_in.html' ... return word (...)
if changes from one view to another , You can also use it to include a single view and simply to show special content based on user status:
{{auth.user:}} & lt ; Div & gt; Welcome, {{= auth.user.first_name}}} & lt; / Div & gt; {{Pass}}