Skip to content

Instantly share code, notes, and snippets.

@dimitrov
Last active August 29, 2015 14:00
Show Gist options
  • Save dimitrov/11370215 to your computer and use it in GitHub Desktop.
Save dimitrov/11370215 to your computer and use it in GitHub Desktop.
import os
from django.dispatch import receiver
from rosetta.signals import post_save
@receiver(post_save)
def restart_server(sender, **kwargs):
os.system('initctl reload <myapp>')
description "myapp"
start on (filesystem)
stop on runlevel [016]
respawn
console log
setuid nobody
setgid nogroup
chdir /var/www/myapp
exec /root/.virtualenvs/myapp/bin/gunicorn_django -c gunicorn.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment