How to call bash process from within django / wsgi?

Posted by chang on Stack Overflow See other posts from Stack Overflow or by chang
Published on 2010-04-09T14:56:58Z Indexed on 2010/04/09 15:23 UTC
Read the original article Hit count: 401

Filed under:
|
|
|
|

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.

© Stack Overflow or respective owner

Related posts about django

Related posts about python