[Answer]-Good way to handle running python script in background with Django?

1👍

You could use python subprocess built-in module. Correctly using Popen Objects you can start a process, see it’s running status with Popen.poll(), wait for it to finish with Popen.wait() or even communicate with it or terminate it. So I guess you could have a variable in Django/Python that sets to False everytime you star a process and while that variable is False you can display a status on the site, once it finished you set the variable to True and do your stuff.

Leave a comment