Skip to content

Instantly share code, notes, and snippets.

@victorouttes
Created August 28, 2019 19:01
Show Gist options
  • Save victorouttes/cd993f615b583dc4b4820b71e1d92831 to your computer and use it in GitHub Desktop.
Save victorouttes/cd993f615b583dc4b4820b71e1d92831 to your computer and use it in GitHub Desktop.
Utilizar supervisor para deploy de Django

Supervisor para deploy de Django

Depois de preparar o projeto Django, criar o "venv" e configurar o Nginx:

sudo apt-get install supervisor

Criar um arquivo *.conf na pasta

/etc/supervisor/conf.d/

Com o conteúdo (adapte para seu uso):

[program:gunicorn]
command=/home/victorm-adm/aplicacaodjango/venv/bin/gunicorn aplicacaodjango.wsgi:application
directory=/home/victorm-adm/aplicacaodjango/
user=nobody
autostart=true
autorestart=true
redirect_stderr=true

Depois basta rodar os comandos:

sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start gunicorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment