Files @ a5d38f30094b
Branch filter:

Location: majic-ansible-roles/roles/wsgi_website/templates/systemd_wsgi_website.service.j2

branko
MAR-132: Workarounds for wsgi_website Python virtual environment in Debian Stretch:

- Manually install setuptools in Python virtual environment on Debian
Stretch, otherwise the pkg-resources==0.0.0 package will mess with
pip freeze etc.
- Add back installation of futures package, even on Python 3 (since it
does not cause any harm).
- A small cleanup of how requirements are treated will be done in
separate ticket.
[Unit]
Description=Website {{ fqdn }}
Requires={{ fqdn }}.socket
After=network.target

[Service]
User={{ user }}
Group={{ user }}
WorkingDirectory={{ home }}/code
ExecStart={{ home }}/virtualenv/bin/gunicorn --bind unix:/run/wsgi/{{ fqdn }}.sock {% if use_paste %}--paste {{home}}/code/{{ wsgi_application }}{% else %}{{ wsgi_application }}{% endif %}

{% for var, val in environment_variables.iteritems() %}
Environment="{{ var }}={{ val }}"
{% endfor %}

ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
UMask=0007

[Install]
WantedBy=multi-user.target