Re: Log is full with redirection messages...

Graham Dumpleton <[email protected]>
Newsgroups gmane.comp.python.mod_python
Message-ID <[email protected]>
2009/3/31 Durumdara <[email protected]>:
> Hi!
> Please suggest me some tips, how to avoid this effect.
> I have a "shop" that have "items".
> When item purchased without problems, I redirect the user to the page to
> avoid F5/Refresh effect and to show some "success" message.
> When some item not existing, I redirect the user to the page "Does not
> exists!".
> I do this with:
>    util.redirect(R.Request, './page.ptml', 1)

The second argument to util.redirect() must be a proper URL, inclusive
of 'http://host' to work properly. Some browsers may work if absolute
path for same site, but not guaranteed. Definitely should not be a
relative path.

So, use an absolute URL path and pass it through req.construct_url()
to have appropriate 'http://host' added at the front.

  util.redirect(R.Request, req.construct_url('/some/absolute/url/page.ptml'), 1)

Graham

> Because of this, the error log is full with "non-error" elements, and it is
> hard to find the real errors.
> The web spiders uses caches, and steps to many items that "vanished now", so
> my is log is 95% of redir messages.
> Please help me a little: how to redirect them without error messages, and
> how to make 404 or other error without see the silent exception in the log?
> Thanks for your help:
>    dd
>
>
>
> _______________________________________________
> Mod_python mailing list
> [email protected]
> http://mailman.modpython.org/mailman/listinfo/mod_python
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.