How to call bash process from within django / wsgi?
- by chang
I'm using mod_wsgi apache2 adapter for a django site and I like to call some bash process within a view, using the usual
...
p = subprocess.Popen("/home/example.com/restart-tomcat.sh", shell=True)
sts = os.waitpid(p.pid, 0)[1]
...
This code works perfectly from within a usual python shell but does nothing (I can trace right now) when called within django. Am I missing some wsgi constraints? The script has 755 perms, so it should be executable.
Thanks.