I have a problem with executing my node js script. When i run this script normally from command line everything is ok.
But when i want to execute that script directly from django it will print error like this:
the first line says that you are in the code before that line of code what execute that script. Second is path and is correct as you see. Third and to the error are files in that directory (I was checking if executing commands from command line works)
I recall that this django project runs in docker container so i think that error might be there.
Here is my line of code where i run that script in my view.py:
def prepare_log_img(picture):
string_without_header = re.sub('^data:image/.+;base64,', '', picture)
img_data = base64.b64decode(string_without_header)
filename = SITE_ROOT + "/faceId/logged.png"
with open(filename, 'wb') as f:
f.write(img_data)
os.chdir(SITE_ROOT + "/static/scripts")
print("Pred face detection")
print(SITE_ROOT + "/static/scripts")
print(os.system("ls"))
os.system("node face-detection.js logged.png")
The last line is that executing. Anyone knows what is the problem? Thank you.

