1π
β
I know my answer might not satisfy all of your needs and itβs not very fast to implement, but I was thinking that in your Django app you could send a Linux su - your_user
command (which would set the correct Linux user based on the currently logged in Django user) using Pythonβs subprocess
and then, still using subprocess
, call the jobs/tasks which need to be executed.
Subprocess: https://docs.python.org/3.4/library/subprocess.html
EDIT: you can also have a look at Pexpect https://github.com/pexpect/pexpect
π€mastazi
Source:stackexchange.com