The main view of my internal web app is a form with an upload field,
and when the user uploads a file, my server-side processing takes
about 15 seconds to complete (I generate and then compile some stuff
based on the file they upload, and return the compiled result)

>From the user's POV, it just looks like it takes 15 seconds for the
next page to load after pressing "Submit".

Because it's an internal app, that's technically ok, but I'd like
something a bit nicer. I think it'd be helpful to have a small div on
the page constantly updating with the progress of the server side
work, after they press Submit.

What I'm thinking, is doing an XMLHTTPRequest after they press Submit.
The first response would be something like "Beginning generation",
which I'd update onto the page. Then I'd send out another
XMLHTTPRequest, who's eventual response will be "Generation done,
beginning compile". Etc etc etc.

The thing is, I'm not sure how to fit that into Django. Currently, my
view function just blocks on the generation/compilation. To do this
with AJAX, it feels like I'd have to spawn a thread from Django to do
the processing, and let the view return immediately. But when the
resulting page does the first XMLHTTPRequest, how can I guarantee that
it'll hit the same mod_python interpreter that's running my thread?

Is that even a good thing to do with mod_python?

Any suggestions would be greatly appreciated. I've only done a little
bit of playing around with AJAX technologies so far, and I've never
used Apache+mod_python before, so there are a lot of unknowns for me.
I also haven't tried out the Session middleware yet, so I don't know
how helpful that will be.

Thanks,
Jay P.

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

Reply via email to