[Django]-How to prevent FCGI request timeout in Django

3👍

The guys at Django IRC told to use HttpResponse with a generator to continuously send an output and thus prevent the script from idle-timeout.

The code for using Httpresponse with generator has been wonderfully described here and here.

Thanks everyone!

4👍

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.

👤ilvar

Leave a comment