1

I'm working on a Django project, in which I will need the use of multithreading and multiprocessing concepts (Send and receive data from other servers such as PACS server/ I/O Threads... ).

The question I have is Django capable of applying multithreading /multiprocessing?

Thank you

1 Answers1

0

By far the most popular tool in the Django world for doing this is Celery Here is a good intro tutorial

There are some more lightweight packages like Dramatiq and django-db-queue, which are intended for use cases where the configuration associated with Celery could be considered overkill.

You could, of course, 'roll-your-own' with the threading module, as sketched out in this answer

PJ Simpo
  • 214
  • 1
  • 8
  • Thank you, going to learn celery now – Oussama Eddahri Dec 07 '21 at 15:16
  • I have seen in some examples that, celery is used with rabitMQ and redis, we can use celery without them right? @pj-simpo – Oussama Eddahri Dec 07 '21 at 15:18
  • @OussamaEddahri No, celery will require a message queue and a backend: https://docs.celeryproject.org/en/stable/getting-started/backends-and-brokers/index.html. Maybe django-db-queue is more suited to your requirements? – PJ Simpo Dec 07 '21 at 15:28