Search code examples
pythonwsgiuwsgi

How to configure uwsgi to use multiple python paths


Is it possible to configure uwsgi to use multiple python paths?

I have defined a python path in my uwsgi.ini file, but I need to also use a code from a second python project. My current python path configuration:

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

Solution

  • There are seem to be at least 4 ways to achieve that:

    1. specify pythonpath twice in uwsgi.ini;
    2. pass --pythonpath argument to uwsgi command twice;
    3. set PYTHONPATH environment variable with paths concatenated with a colon;
    4. add extra paths to sys.path somewhere in your code.