Answer the question
In order to leave comments, you need to log in
How to make Django run a remote interpreter with superuser privileges when debugging?
Good afternoon. Tell me how to make Django run a remote interpreter with superuser rights when debugging? The fact is that without them it will not be possible to interact with the GPIO, on which a lot is tied.
I saw on stackoverflow a solution to create a small bash script that would execute sudo python3 and forward all arguments. But, unfortunately, I’m not in the tooth with my foot, so I can’t realize this.
Can anyone help?
Answer the question
In order to leave comments, you need to log in
Well then. Solved the problem myself. True in its own way - in four lines in python:
#!/usr/bin/env python3
from sys import argv
from subprocess import Popen
Popen(["sudo", "python3"] + argv[1:]).wait()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question