I've built an application in Django.
While testing I've used manage.py runserver commando. Now when I am done, I've transferred the Django application to Gunicorn.
All works fine, except one thing:
The web application has an option to shutdown and reboot the Ubuntu server machine (for logged in admin users).
When running the application using manage.py runserver, it had permissions to do it.
But now with gunicorn, it doesn't. However it's maybe not fully save, I now the risks and want to do it.
Does anyone have an option to shutdown and reboot the Ubuntu machine using the Django application?
With manage.py runserver I've used:
cmd = "sleep 5 && reboot"
result = subprocess.Popen(cmd, stdout=subprocess.PIPE,shell=True)
Thanks for the replies.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…