GUNICORN Deployment
1 2 3 4 5 | source .venv/bin/activate python manage.py migrate python manage.py collectstatic sudo systemctl restart gunicorn sudo systemctl reload nginx |
- activate python virtual environment for next calls of python
- change database model if needed by executing migrations
- copies static files to STATIC_ROOT (defined in settings.py) to which gunicorn looks and to which nginx has to look at
- restarts gunicorn to update the server (needed, if code has changed - not if only staticfiles changed)
- reloads nginx configuration (only needed, if nginx configuration changed)
