3👍
✅
As you’re trying to run python script, you may simply import code from launch_instances.py into your view, redirect output to /home/bitnami/launcinstances.log (about redirecting stdout to file in python: Redirect stdout to a file in Python?). But there’s still problem with root privileges – one option is to change permissions of: resources needed for calling code from launch_instances.py; your log file; to allow your django process to execute that, second option (not recommended) is to run django app as root.
3👍
Most likely it has something to do with permissions. Try examining stderr and stdout of your command execution. I’m using this code to debug my shell commands:
process = subprocess.Popen(shlex.split(command), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output,error = process.communicate(input=pipe)
- [Django]-403 error code when using axios.post to Django endpoint in React app
- [Django]-Reflection in python
- [Django]-How to (intentionally) skip an app with Django syncdb
- [Django]-Can I do Django & Python web development using Xcode 3.2?
- [Django]-Django calling no request view function in template
Source:stackexchange.com