Right way to have a thread in parallel to django project on wsgi.
- by Enrico Carlesso
Hi guys.
I'm writing a django project, and I need to have a parallel thread which performs certain tasks.
The project will be deployed in Apache2.2 with mod_wsgi.
Actually my implementation consists on a thread with a while True - Sleep which is called from my django.wsgi file.
Is this implementation correct?
Two problems raises: does django.wsgi get called only once? Will I have just that instance of the thread running? And second, I need to "manually" visit at least a page to have the Thread run. Is there a workaround?
Does anyone has some hints on better solutions?
Thanks in advance.