How to prevent FCGI request timeout in Django
Timeout is in webserver, not in Django. You make a request to webserver and get a response from it, so you can't get anything outside of that response. In your case you should create a background task on server, usually getting started by cron or celery (it hink you can't run celery on hostgator so use cron) with a queue of tasks. On the cliend side you periodically make requests to server using AJAX, so you can check status of a task and display notification if it is completed.
I have a webhook which takes a little time to complete (around 5 minutes). However, the request gets timeout after around 30 seconds.
I am on a shared hosting with HostGator and using FCGI for deployment.
I think the request gets timed-out as there is not HTTPResponse until the request is processed. If I can generate some HTTPResponse from view while the request is processed, the script might be able to run longer.
[P.S.: Earlier I tried Google App Engine, where using print 'hi' would print 'hi' in browser instead of logging it. Is the same possible with Django. Doing so might send response even while the request completes.] (I was told on Django IRC that even I was able to get print to send message as response, it will only throw out when Httpresponse is returned.) Thus it was suggested to use Httpresponse with an iterable.