uwsgi: permission denied problem of python script
Hello, I encountered a permission denied problem when the script was executed to create a new directory.
the directory to be created is located in /home/result which needs root permission to access. So I run the uwsgi with sudo and a warning occurred as following:
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
Then I add uid and gid options to the configuration file but a permission denied problem is reported like this
[Errno 13] Permission denied: '/home/result/test (test is the new directory I want to create).
Here is my configuration file
[uwsgi]
module = demo:app
protocol = http
master = true
processess = 2
chdir = /media/xi/FlasklrProj
lazy-apps = true
touch-chain-reload = true
uid = root
gid = root
http-socket = 0.0.0.0:5000
logto = /media/xi/FlasklrProj/demo.log
vacuum = true
post-buffering = 65536
buffer-size = 65536
How can I resolve it? Could anyone give me some helps?Thank you
This is a unix permission issue, should be closed.