Skip to content Skip to sidebar Skip to footer

How To Fork A Process In Python/django?

This is more of a Python general question however in a context of django. For now I have this view in django which has to process a lot of data. Usually it takes the server (nginx

Solution 1:

the 'best practice' answer is to use a queue manager, typically RabbitMQ or any backend handled by Django-celery.

Still, there are a few lighter options that do spawn a new thread. what these options usually lack is some way to track progress, or keep the number of threads under control.

check Django-utils to see if it's enough. if not, go for Celery.

Solution 2:

If you really want to fork and set priority, you can use os.fork and os.nice, but I think the multiprocessing module or Celery would be more applicable here.

Post a Comment for "How To Fork A Process In Python/django?"