2019-09-11 20:47:06 +00:00
|
|
|
#!/usr/bin/env python3
|
2020-07-18 02:13:20 +00:00
|
|
|
"""
|
|
|
|
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
|
2015-03-31 18:15:22 +00:00
|
|
|
|
|
|
|
import os
|
2019-08-28 01:46:04 +00:00
|
|
|
import sys
|
|
|
|
|
2020-07-18 02:13:20 +00:00
|
|
|
# User has the virtual environment in ~/env/
|
2019-09-11 20:47:06 +00:00
|
|
|
INTERP = os.path.expanduser("~/env/bin/python3")
|
2015-03-31 18:15:22 +00:00
|
|
|
if sys.executable != INTERP:
|
|
|
|
os.execl(INTERP, INTERP, *sys.argv)
|
|
|
|
|
|
|
|
sys.path.append(os.getcwd())
|
2020-07-18 02:13:20 +00:00
|
|
|
|
|
|
|
# Phusion Passenger expects this file to be called `passenger_wsgi.py`
|
|
|
|
# and the WSGI object to be called `application`
|
2022-05-02 16:18:32 +00:00
|
|
|
from app import create_app
|
2019-08-28 01:46:04 +00:00
|
|
|
|
2022-05-02 16:25:54 +00:00
|
|
|
application, appmgr = create_app()
|
2022-05-02 16:21:27 +00:00
|
|
|
|
2019-08-28 01:46:04 +00:00
|
|
|
# For running on the server with passenger etc
|
|
|
|
if __name__ == "__main__":
|
2019-09-11 20:47:06 +00:00
|
|
|
application.run()
|