如何配置 uwsgi 使用多个 python 路径

How to configure uwsgi to use multiple python paths

是否可以将 uwsgi 配置为使用多个 python 路径?

我在 uwsgi.ini 文件中定义了 python 路径,但我还需要使用第二个 python 项目中的代码。我当前的 python 路径配置:

pythonpath = /Users/vingtoft/Documents/Development/archii/server/archii2/app/

似乎至少有 4 种方法可以实现:

  1. 在uwsgi.ini中指定pythonpath两次;
  2. --pythonpath参数传递给uwsgi命令两次;
  3. 设置 PYTHONPATH 环境变量,路径用冒号连接;
  4. 在您的代码中的某处添加指向 sys.path 的额外路径。