Behavior of Python subprocess on django+nginx

Viewed 43

I have a simple code like:

subprocess.run(
    ["python3",
     "action.py",
     "--options"]
)

In action.py I import some packages, perform a small script

It works properly when I launch it on the built-in Django-server, but when I add Nginx-server as a wrapper, I get

 "ModuleNotFoundError: No module named 'modulename'".

Why this error might occur exactly with Nginx and how I can correct it?

Launch with shell=True or venv="path/to/venv" don`t work for me

0 Answers
Related