views:

28

answers:

1

I am creating a chat like facebook chat... so in views.py of my Chat Application, I need to retrieve only the last messages every 3-4 seconds with ajax poll ( the latency is not a problem for me ).

If I can disable some Middlewares and some Request Context in this view, the response will be faster... no ?

My question is:

Is there a way to disable some Middlewares and some Request Context in some views ?

+3  A: 

This is not likely to be feasible. Best to have a second Django project or WSGI app to handle these requests.

Ignacio Vazquez-Abrams
+I agree w/ I V-A, especially if you're talking about disabling some django.contrib middleware such as sessions, messages or auth. You can write in some short-circuits to your *own* middleware by checking request.path first and only doing the meat of process_request / process_response if the path is not one to skip the middleware processing for, but that's not gonna help you with the django.contrib.* stuff that may be the bulk of your middleware processing.
stevejalim