aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJocelynDelalande <JocelynDelalande@users.noreply.github.com>2018-07-16 22:55:54 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2018-07-16 22:55:54 +0200
commitc3f8ddd274a40b164b5fceeab44c1c26cf053b04 (patch)
treea1cbcdda21eb2861a20b8b6b32a6ffddaa054044
parent230eafdf58c46b983936cbf4f70b712bbddfd8c9 (diff)
downloadihatemoney-mirror-c3f8ddd274a40b164b5fceeab44c1c26cf053b04.zip
ihatemoney-mirror-c3f8ddd274a40b164b5fceeab44c1c26cf053b04.tar.gz
ihatemoney-mirror-c3f8ddd274a40b164b5fceeab44c1c26cf053b04.tar.bz2
Fix Apache conf template, without relying on environment var (#359)
`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
-rw-r--r--ihatemoney/conf-templates/apache-vhost.conf.j22
-rwxr-xr-xihatemoney/manage.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/ihatemoney/conf-templates/apache-vhost.conf.j2 b/ihatemoney/conf-templates/apache-vhost.conf.j2
index 0527d31..e169589 100644
--- a/ihatemoney/conf-templates/apache-vhost.conf.j2
+++ b/ihatemoney/conf-templates/apache-vhost.conf.j2
@@ -1,7 +1,7 @@
<VirtualHost *:80>
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 9058b39..3207b55 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(),
))