Commands for Django, Gunicorn, and Nginx

2023-09-09 12:54:04

IT

System Development

Startup, Restart, Stop, and Find Process Commands

Startup, Restart, Stop, and Find Process Commands for Django, Gunicorn, and Nginx

Django

  • Start Development Server: python manage.py runserver
  • Restart Development Server: Stop the server and run python manage.py runserver again.
  • Stop Development Server: Use Ctrl+C in the terminal where the server is running.
  • Find Process: ps aux | grep runserver

Gunicorn

  • Start: gunicorn [OPTIONS] APP_MODULE
  • Restart: If using systemd, systemctl restart gunicorn
  • Stop: If using systemd, systemctl stop gunicorn or kill [PID]
  • Find Process: ps aux | grep gunicorn

Nginx

  • Start: sudo systemctl start nginx
  • Restart: sudo systemctl restart nginx
  • Stop: sudo systemctl stop nginx
  • Find Process: ps aux | grep nginx
pkill -f gunicorn
sudo systemctl start gunicorn
sudo systemctl restart nginx