I tried os.system, os.spwanl, etc.. but it doesn't work well
I need to execute some background process from django application.
I tried os.system, os.spwanl, etc.. but it doesn't work well
I need to execute some background process from django application.
The subprocess module gives you much finer-grained control over spawning processes than afforded by os.system.
I have used subprocess to spawn background processes from Django before. It may depend on your environment, but I had no issue using it with both modpython and modwsgi.
I've used paramiko to put the process in background for localhost/remote hots..,
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(host,user,pwd,port,.......)
si, so, se = ssh.exec_command('nohup' + cmd + '&')
so.read()
se.read()
has resolved the issue....