Skip to content

Instantly share code, notes, and snippets.

@exit99
Last active August 29, 2015 14:11
Show Gist options
  • Save exit99/080887af422421d58101 to your computer and use it in GitHub Desktop.
Save exit99/080887af422421d58101 to your computer and use it in GitHub Desktop.
How to run django scripts in supervisord
#! /usr/bin/env python
from time import sleep
if __name__ == "__main__":
while True:
do_stuff()
sleep(1)
chmod +x
/etc/suprvisor/conf.d/myprogram.conf
[program:render_plans]
command=/srv/www/my.site.com/bin/render_script.py
environment=PYTHONPATH='.:apps',DJANGO_SETTINGS_MODULE='my_project.settings'
directory=/srv/www/my.site.com
user=nobody
autostart=true
autorestart=true
stdout_logfile=/var/log/render_upgrades.log
stderr_logfile=/var/log/render_upgrades.log
stopwaitsecs=3
priority=998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment