[Answered ]-Install mod-wsgi in a poetry virtual environment

1👍

If Apache mod_wsgi refuses to use the virtual env, you can try gunicorn or uwsgi instead. Both can serve HTTP. You can use Apache with mod_proxy to forward requests or you can consider directly exposing uwsgi or gunicorn. You can also mod_uwsgi to Apache talk over uwsgi protocol. Nginx supports uwsgi too.

Doesn’t look like Apache knows about Poetry or the virtual environment. I would try wrapping your wsgi.py in a shell script that uses Poetry to start wsgi.py. That way Apache can use the wrapper script which will force it to use the right Python version.

The script should look like:

#!/bin/sh
exec poetry run python wsgi.py

And then Apache config should use:

WSGIScriptAlias / /var/www/html/GameManager/app/my-script-that-calls-poetry-run-python-wsgi-py.sh

👤kichik

Leave a comment