Django view and separate processes
Andrey Fedoseev gave a great suggestion, but let me come up with a more general solution. You can create some WaitingTasks model into which where your view puts new tasks. Then, there can use any method to process those waiting tasks - cronjob, upstart daemon, whatever - writing back progress and result. 
(In fact celery uses a similar approach, only with RabbitMQ)
I would like to do something similar:
f(n) calculates n! , this obviously takes a long time to do, so the calculations need to run in a separate process from the django view. Additionally I would like the view to return a response immediately (ex.  progress 0% ) and subsequent polling needs to update progress, so the view needs to communicate with the above process.
What would be the best way to achieve this?