[Answered ]-Python close all threads or processes with subprocess.Popen

2👍

You run the Django start script, everything gets initialized and set up and then that newly created Django process goes to background (gets * daemonized*) disconnected from your thread.

So, when you kill that thread, you actually kill nothing because that start-up script has done its job and has probably already exited.

After the start-up script is run, a new Django process is created. Experiment on your machine and find its name. Then you can run something like sudo killall django_process from within your program.

Leave a comment