On Jul 12, 2010, at 12:36 , Wyatt Baldwin wrote:

>>> But this is Pylons, so not only do you have a detailed log, it is also an 
>>> interactive debugger, allowing you to directly interrogate the app state:
>> 
>>> http://pylonshq.com/docs/en/1.0/debugging/
>> 
>> Thanks for the advice, but I'm still confused.
>> 
>> The docs advise me to do this in my config/middleware.py:
>> 
>> if asbool(full_stack):    
>>         # Handle Python exceptions
>>         app = ErrorHandler(app, global_conf, **config['pylons.errorware'])
>>         # Display error documents for 401, 403, 404 status codes (and
>>         # 500 when debug is disabled)
>>         if asbool(config['debug']):
>>                 app = StatusCodeRedirect(app)
>>                 else:
>>                 app = StatusCodeRedirect(app, [400, 401, 403, 404, 500])
>> 
>> I currently have this in my config/middleware.py:
>> 
>>     app = make_middleware_with_config(
>>         app,
>>         global_conf,
>>         who_config,
>>         app_conf['who.log_file'],
>>         app_conf['who.log_level'],
>>         skip_authentication=asbool(app_conf.get('skip_authentication', 
>> 'false'))
>>     )
>> 
>> Do I append the if asbool… stuff? Somehow merge it with what I've got?
> 
> If the only thing that's in your middleware file is the who app, you
> almost certainly want to add back at least the ErrorHandler
> middleware. That's the middleware that brings up the Web based
> debugger when you're in debug mode.

I'm afraid I'm a little too new to Pylons to follow what you're saying there, 
and I can't find where in the docs it has the answer, either (the only place 
where it's described in any detail is one screenful showing one example in 
<http://pylonshq.com/docs/en/1.0/configuration/#middleware-config>. Is there 
documentation somewhere about what I can do in this file?

In any event, how do I merge the two configs above? They are written rather 
differently. Why is that? When do I use make_middleware_with_config, and when 
do I use ErrorHandler?

Most important, is all this stuff actually documented somewhere?

-- 
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.

Reply via email to