I've got a Django app, which calls a program using subprocess.call()
. This program creates a couple of files, which I then use back in my app. The problem is the program doesn't seem to have permission to create files. I also tried calls like subprocess.call(['mkdir','/tmp/myapp'])
but the directory was not created. What do I need to do?
This is just with my dev server at the moment, which I invoke with
sudo python manage.py runserver 0.0.0.0:8080
I can run the command from the terminal manually fine.
I can also use subprocess to touch
the files, which it does fine, but when it runs the program that accesses the files itself, that program throws an error because it cannot.