Skip to content

Instantly share code, notes, and snippets.

@paneru-rajan
Last active March 21, 2018 11:16
Show Gist options
  • Save paneru-rajan/f072d4c162fecb789b9fdb80043b2a93 to your computer and use it in GitHub Desktop.
Save paneru-rajan/f072d4c162fecb789b9fdb80043b2a93 to your computer and use it in GitHub Desktop.
Setting up supervisor on django with uswgi
  1. Supervisor File /etc/supervisor/conf.d/prod-scraper.conf
[program:prod-scraper]
directory=/home/nwc/app/production/news-scraper/src/
command=/home/nwc/app/production/venv/bin/uwsgi --ini /home/nwc/app/production/news-scraper/src/crawleradmin.ini
autostart=true
autorestart=true
stderr_logfile=/var/log/prod-scraper.err.log
stdout_logfile=/var/log/prod-scraper.out.log
  1. Uwsgi File crawleradmin.ini
[uwsgi]
http-socket = 0.0.0.0:9000
#uwsgi-socket = var/tmp/uwsgi.sock
http-processes = 4
http-master = 1
http-timeout = 1800
module = crawleradmin.wsgi:application
pidfile=tmp/crawleradmin-master.pid
#daemonize=log/crawleradmin.log
static-map = /static=static
# cache
# cache2 = name=mycache,items=1000
mime-file = /etc/mime.types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment