From d86ea85cea8e9b514afaed0cb353c932cd510ad8 Mon Sep 17 00:00:00 2001 From: Jocelyn Delalande Date: Mon, 16 Jul 2018 22:23:56 +0200 Subject: [PATCH] Fix Apache conf template, without relying on environment var `python-home` is prefered over `python-path`. It will work with or without a virtualenv. See http://modwsgi.readthedocs.io/en/develop/configuration-directives/WSGIDaemonProcess.html --- ihatemoney/conf-templates/apache-vhost.conf.j2 | 2 +- ihatemoney/manage.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ihatemoney/conf-templates/apache-vhost.conf.j2 b/ihatemoney/conf-templates/apache-vhost.conf.j2 index 0527d310..e169589a 100644 --- a/ihatemoney/conf-templates/apache-vhost.conf.j2 +++ b/ihatemoney/conf-templates/apache-vhost.conf.j2 @@ -1,7 +1,7 @@ ServerAdmin admin@example.com # CUSTOMIZE ServerName ihatemoney.example.com # CUSTOMIZE - WSGIDaemonProcess ihatemoney user=www-data group=www-data threads=5 python-path={{ pkg_path }} {% if bin_path %}python-home={{ bin_path }}{% endif %} + WSGIDaemonProcess ihatemoney user=www-data group=www-data threads=5 python-home={{ sys_prefix }} WSGIScriptAlias / {{ pkg_path }}/wsgi.py WSGIPassAuthorization On diff --git a/ihatemoney/manage.py b/ihatemoney/manage.py index 9058b390..3207b558 100755 --- a/ihatemoney/manage.py +++ b/ihatemoney/manage.py @@ -52,6 +52,7 @@ class GenerateConfig(Command): print(template.render( pkg_path=pkg_path, bin_path=bin_path, + sys_prefix=sys.prefix, secret_key=self.gen_secret_key(), ))