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?
-
2you could use the subprocess module: stackoverflow.com/a/546024/630877arie– arie2012-05-21 16:00:52 +00:00Commented May 21, 2012 at 16:00
-
arie, thanks, I will use that. Can you answer below so I can mark your answer?jeffci– jeffci2012-05-22 13:11:44 +00:00Commented May 22, 2012 at 13:11
-
1I turned my comment into an answer. Happy subprocessing!arie– arie2012-05-22 15:25:12 +00:00Commented May 22, 2012 at 15:25
Add a comment
|