[mod_python] Log is full with redirection messages...

Durumdara durumdara at gmail.com
Tue Mar 31 06:42:10 EDT 2009


Hi!

Thanks for your idea.
I found the base of the error.
In the beginings I don't know mod_python good, and I handle the errors in my
way:

try:
    DoProcess
except:
    if DevelopMode:
       raise
    else:
       LogToApache(GetLastError)

I changed this in every site to DebugMode = Off /On way, but in this I
forget to do...
Because in the first time I don't know about DebugMode's "Log error to the
apache logs only" effect.


If I simplified to:

DoProcess

and to DebugMode (On/Off)

the redirection messages are vanished...

This happening with me many times, because I develop many thing that is
already in the systems, only I do not read the F* manual fully... :-)

See "req.construct()" is in my older way:
        self.FullURL = 'http://' + self.Request.hostname + '' +
self.Request.unparsed_uri
        self.FullURLNoArgs = 'http://' + self.Request.hostname + '' +
self.Request.uri

:-)

Thanks for your help:
   dd

2009/3/31 Graham Dumpleton <graham.dumpleton at gmail.com>

> 2009/3/31 Durumdara <durumdara at gmail.com>:
> > 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
> > Mod_python at modpython.org
> > http://mailman.modpython.org/mailman/listinfo/mod_python
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20090331/4366dd8b/attachment.html


More information about the Mod_python mailing list