Can't run os.system command in Django?
We have a Django application running on an apache server (mod_python) on a windows machine that requires some r scripts to be called. It would be easier to call r through os.system for this, however, when django hits the os.system command, it freezes. I have also tried sub-process with the same result.
We have a related issue, since Django can only access the machine's file system, all network drives appear invisible to it, which is very frustrating.
Any ideas on both of these issues (I assume it's the same limitation in both cases) would be most appreciated.
a source to share
Instead os.system
, does RPy2 meet your needs? I used it in a similar case to the one you describe with Django, and it worked well enough.
The high-level interface in rpy2 is designed to make it easier for Python programmers to use R. R objects appear as instances of Python classes, with R functions being bound methods on these objects in some cases.
a source to share