Created
April 25, 2014 13:53
-
-
Save dimitrov/11290347 to your computer and use it in GitHub Desktop.
django-rosetta - Gunicorn auto reload
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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