W
W
wutiarn2014-02-18 21:37:00
linux
wutiarn, 2014-02-18 21:37:00

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

1 answer(s)
W
wutiarn, 2014-02-19
@wutiarn

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()

The solution is perfect for me. Well, maybe minus 5 megabytes of RAM. But this is not critical even for raspberry.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question