Home:ALL Converter>Is there any possibility to execute command of the server in django? the location?

Is there any possibility to execute command of the server in django? the location?

Ask Time:2012-09-22T02:13:18         Author:Wei Lin

Json Formatter

I try to do this by using subprocess in a views.py

returnCode = subprocess.call('/Users/ivanlw/Projects/C/app') #use the absolute path
print 'returnCode', returnCode

the app file just prints a sentence, it's normal when I execute it in the terminal

but finally the debug page of django tells me OSError, the Exception Value shows: [Errno 2] No such file or directory

How to solve it?

Author:Wei Lin,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12535952/is-there-any-possibility-to-execute-command-of-the-server-in-django-the-locatio
yy