Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I put a process in background using django?

I tried os.system, os.spwanl, etc.. but it doesn't work well

I need to execute some background process from django application.

like image 631
shahjapan Avatar asked May 20 '10 09:05

shahjapan


People also ask

How do I run a background task in Python?

We can configure a new daemon thread to execute a custom function that will perform a long-running task, such as monitor a resource or data. For example we might define a new function named background_task(). Then, we can configure a new threading. Thread instance to execute this function via the “target” argument.

What is Django Q?

Django Q is a native Django task queue, scheduler and worker application using Python multiprocessing.

What is a Django worker?

A simple background task worker that uses your Django database and admin for management. This project is meant for small to medium scale uses. If you need something more, check out Celery.


1 Answers

Try to use celery. It was originally created for this purpose and also supports scheduling tasks.

like image 176
dragoon Avatar answered Oct 04 '22 02:10

dragoon