N
N
Nikolai Pavlov2016-06-16 07:41:35
Django
Nikolai Pavlov, 2016-06-16 07:41:35

Where is the right place to run background threads in a Django app?

Hello.
There is a Django application in which certain tasks are launched via the web, now I am implementing a task scheduler, and tasks that were launched manually via the web will be launched automatically according to the schedule, all this is implemented through a background thread that must be started when the entire circuit starts (tornado web serve + django), the question arose, where is the right place in the django project to start such background threads? Now I'm running applications in the admin.py module of django, everything works, but is this the right approach? It's not clear at what point django calls the contents of admin.py and what pitfalls might there be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey K, 2016-06-16
@PavlovNik

There is a great tool for this ( Celery ). Why fence something of your own?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question