Better document Passenger file to avoid surprises

This commit is contained in:
Midgard 2020-07-18 04:13:20 +02:00
parent 8a01e74323
commit 2d3ae10f90
Signed by: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -1,14 +1,23 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"Script to run Haldis on a server" """
Used by Zeus in production.
This script makes Haldis acceptable to Phusion Passenger assuming a setup like on Zeus servers.
"""
# pylint: disable=wrong-import-position
import os import os
import sys import sys
# User has the virtual environment in ~/env/
INTERP = os.path.expanduser("~/env/bin/python3") INTERP = os.path.expanduser("~/env/bin/python3")
if sys.executable != INTERP: if sys.executable != INTERP:
os.execl(INTERP, INTERP, *sys.argv) os.execl(INTERP, INTERP, *sys.argv)
sys.path.append(os.getcwd()) sys.path.append(os.getcwd())
# Phusion Passenger expects this file to be called `passenger_wsgi.py`
# and the WSGI object to be called `application`
from app import app as application from app import app as application
# For running on the server with passenger etc # For running on the server with passenger etc