Skip to content

Instantly share code, notes, and snippets.

@dimitrov
Created April 25, 2014 13:53
Show Gist options
  • Save dimitrov/11290347 to your computer and use it in GitHub Desktop.
Save dimitrov/11290347 to your computer and use it in GitHub Desktop.
django-rosetta - Gunicorn auto reload
import os
from django.dispatch import receiver
from rosetta.signals import post_save
@receiver(post_save)
def restart_server(sender, **kwargs):
os.system('supervisorctl pid <gunicorn process> | xargs kill -HUP')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment