I want to be able to execute some shell commands like mkvirtualenv
and createdb
and such from a Django app, these processes will likely go into a Django celery task later. I would think using system() would be insecure to execute shell commands from Django/Apache, so my question is what is the best way to execute shell commands from a django app?
Asked
Active
Viewed 651 times
0

jeffci
- 2,537
- 6
- 37
- 59
-
2you could use the subprocess module: http://stackoverflow.com/a/546024/630877 – arie May 21 '12 at 16:00
-
arie, thanks, I will use that. Can you answer below so I can mark your answer? – jeffci May 22 '12 at 13:11
-
1I turned my comment into an answer. Happy subprocessing! – arie May 22 '12 at 15:25