Skip to content

Instantly share code, notes, and snippets.

@vperron
Created March 9, 2015 14:22
Show Gist options
  • Save vperron/9db66663de0767ca046b to your computer and use it in GitHub Desktop.
Save vperron/9db66663de0767ca046b to your computer and use it in GitHub Desktop.
roles/uwsgi/templates/upstart.uwsgi.conf.j2
# simple uWSGI upstart job
description "uWsgi server for {{ application.name }}"
start on runlevel [2345]
stop on runlevel [06]
{% include "templates/env_vars.j2" %}
script
exec /usr/local/bin/uwsgi \
--uid {{ application.user }} \
--gid {{ application.group }} \
--socket {{ uwsgi.socket }} \
--harakiri {{ uwsgi.harakiri }} \
--logto {{ application.log_dir }}/uwsgi.{{ application.name }}.log \
--home {{ application.virtualenv_path }} \
--pythonpath {{ application.path }} \
--env DJANGO_SETTINGS_MODULE={{ django.settings }} \
--module {{ django.wsgi }} \
{% if uwsgi.gevent %}
--gevent {{ uwsgi.gevent }} \
{% endif %}
--master \
--processes {{ uwsgi.processes }} \
--max-requests {{ uwsgi.max_requests }} \
--enable-threads \
--single-interpreter \
--lazy-apps \
-b {{ uwsgi.buffer_size }} \
--file wsgi.py
end script
respawn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment