这是我的代码`
@app.route('/social_add/<us_id>/<us_phone>/<us_birth>/<us_gen>', methods=['POST', 'GET'])
def social_add(us_id, us_phone, us_birth, us_gen):
os.system("sudo chmod 777 /home/gor/tarber/static/user_image")
os.system("mkdir /home/gor/tarber/static/user_image/" + us_id)
os.system("sudo chmod 777 /home/gor/tarber/static/user_image/" + us_id)
这是错误`
gunicorn[119261]: sh: 1: sudo: not found
gunicorn[119261]: sh: 1: mkdir: not found
gunicorn[119261]: sh: 1: sudo: not found
我尝试过此程序`
subprocess.Popen("sudo chmod 777 /home/gor/tarber/static/user_image", shell=True)
subprocess.Popen("mkdir /home/gor/tarber/static/user_image/" + us_id, shell=True)
subprocess.Popen("sudo chmod 777 /home/gor/tarber/static/user_image/" + us_id, shell=True)
但是错误是相同的
os.mkdir(filename, mode=0o777)