From 2d3ae10f907a219976fdee169fbf6ecf948a2894 Mon Sep 17 00:00:00 2001 From: Midgard Date: Sat, 18 Jul 2020 04:13:20 +0200 Subject: [PATCH] Better document Passenger file to avoid surprises --- app/passenger_wsgi.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/passenger_wsgi.py b/app/passenger_wsgi.py index 7fe947b..9d3ebd1 100644 --- a/app/passenger_wsgi.py +++ b/app/passenger_wsgi.py @@ -1,14 +1,23 @@ #!/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 sys +# User has the virtual environment in ~/env/ INTERP = os.path.expanduser("~/env/bin/python3") if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv) 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 # For running on the server with passenger etc