Skip to content

Instantly share code, notes, and snippets.

@guillaumepiot
Last active December 10, 2015 12:05
Show Gist options
  • Save guillaumepiot/25debe5bd6e67b311a2c to your computer and use it in GitHub Desktop.
Save guillaumepiot/25debe5bd6e67b311a2c to your computer and use it in GitHub Desktop.
WSGI - Upstart file for Django 1.9
description "uWSGI server for <domain-name>"
start on runlevel 2
stop on runlevel [016]
respawn
exec /<path-to-myvenv>/bin/uwsgi --chdir=<code_dir> \
--module=<app-name>.wsgi:application \
--env DJANGO_SETTINGS_MODULE=<app-name>.settings.production \
--master --pidfile=/tmp/<mysitename>-master.pid \
--socket=127.0.0.1:<wsgi_port> \
--processes=3 \
--uid=<username> \
--gid=<group_name> \
--harakiri=60 \
--max-requests=500 \
--vacuum \
--home=/var/www/<mysitename>/venv \
--logto /var/www/<mysitename>/logs/wsgi.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment