[mod_python] Path/address bar contents

Sean Davis sdavis2 at mail.nih.gov
Thu Apr 5 09:53:40 EDT 2007


On Thursday 05 April 2007 09:37, Olaf Stein wrote:
> Hi all,
>
> I have a small app that works like this
>
> Somebody visits the start page
>
> http://localhost/apps/start/enter
>
> where start is a python file (start.py) and enter() the function that
> displays the login html (through templates, etc)
>
> After entering credentials and clicking the login button, I call a function
> login() (also in start.py), which checks the credentials and then call
> either the function enter() again (if credentials are not good) or function
> start() (if credentials are good). Basically function login() does not
> create any html output.
>
> The question now is, after logging in and calling start(), the function
> executes correctly, but in the browser's address bar it still shows
>
> http://localhost/apps/start/login
>
> Instead of
>
> http://localhost/apps/start/start
>
> Is this because login() does not create html output and is there anything I
> can do so the "correct" path is shown

You can have login() do a redirect to start() if successful.  Or (probably 
more efficient) call start(), check login() from within start(), and in 
login, do a redirect to enter() if the login criteria are not met.

But I might be misunderstanding something here.

Sean


More information about the Mod_python mailing list