Hello, there.

I am very much interested in this middleware stuff.

I have now a Python data processing script, which normally runs 2 to 3
minutes.  I was trying to use feedback.py to call this external script
as a subprocess, firing it off to run, monitoring its progress, and
return an innerHTML message when the subprocess script finishes its
work.

Can this middleware do such work?

Basically, I need a simple and straightforward solution for the time being.

Your advice and assistance will be deeply appreciated.

Regards.

David

2008/11/20 jwpeddle <[EMAIL PROTECTED]>:
>
> Oh my god the stupidity.
>
> The error was in my 500.html template. NOTHING to do with my
> middleware.
>
> Sigh.
>
> On Nov 20, 1:54 pm, jwpeddle <[EMAIL PROTECTED]> wrote:
>> I've got a custom middleware class (nearly identical in function to
>> the flat page fallback middleware). When I have DEBUG = True, it works
>> as expected. When I have DEBUG = False, I get errors stemming from
>> variables set by the middleware not existing for the templates. After
>> investigating, the only progress I've made is confirming that the
>> class is called somehow (a print statement just inside the class will
>> print) but the process_response never is.
>>
>> Again, this works when debugging is on. Perfectly. Not at all when
>> it's off. Not on apache and not on the dev server. I apologize for the
>> lack of errors, but I haven't narrowed it down enough yet to get any
>> relevant errors.
>>
>> class PageFallbackMiddleware():
>>     def process_response(self, request, response):
>>         if response.status_code != 404:
>>             return response # No need to check for a flatpage for
>> non-404 responses.
>>         try:
>>             return page(request, request.path)
>>         # Return the original response if any errors happened. Because
>> this
>>         # is a middleware, we can't assume the errors will be caught
>> elsewhere.
>>         except Http404:
>>             return response
>>         except:
>>             if settings.DEBUG:
>>                 raise
>>             return response
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to