On Nov 21, 2007 5:35 AM, Justin <[EMAIL PROTECTED]> wrote:
> Just to rule out the possibility that I did somthing wierd I created a
> new project, added a new controller (changed nothing, its index action
> returns 'Hello World', and just add the line to by BaseController to
> print out the class name and received almost the same result:
>
> CtestController
> TemplateController
> ErrorController
> TemplateController
> ErrorController
> TemplateController
> ErrorController
> TemplateController
> ErrorController
>
> And here's the output file (sorry about the length):
As far as I can tell, the output looks correct. TemplateController
returns a Not Found page which passes through the base controller and
is intercepted by the ErrorDocuments middleware, which makes its own
request for a fancy error page.
But as to your original question, why TemplateController is being
invoked at all, I can't tell.
There's a TransLogger middleware you can use to get an Apache-style
access log. You can enable it in middleware like this:
from paste.translogger import TransLogger
app = TransLogger(app, setup_console_handler=True)
I've only had luck putting this *below* the error middleware, although
intuitively it seems it should be above. The problem is that in one
position you don't get the original statuses and URLs, you get the
ones the error middleware has changed them to, which is not helpful
for debugging.
Anyway, if you setup the TransLogger and it shows multiple requests
for the same successful browser request, that will give a little more
light on what Template URL is being requested and why.
Alternatively, you could dump environ['PATH_INFO'] to your 'fp' file.
It may be worth dumping the entire environment actually, something
like:
import pprint; fp.write(pprint.pformat(request.environ))
Things to look for are the URL and routing args that were in effect
when TemplateController was called. The referer would also prove the
previous request called this one. Then the mystery becomes, what in
the previous request caused this one?
You don't need to dump the output anymore, since it looks correct for
the controllers that were called.
--
Mike Orr <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---