Commands for Django, Gunicorn, and Nginx
2023-09-09 12:54:04
IT
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 runserveragain. - Stop Development Server: Use
Ctrl+Cin 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 gunicornorkill [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
sudo systemctl start gunicorn
sudo systemctl restart nginx