将Django部署到生产环境涉及在适当的WSGI/ASGI服务器和Web服务器后面运行它、正确提供静态文件、保护设置以及管理数据库——这与内置的开发服务器有很大区别(内置开发服务器不适合生产环境)。
生产堆栈
Client → NGINX (web server) → GUNICORN (WSGI app server) → DJANGO
│ (runs your Python app, multiple workers)
└─ serves static/media files directly (efficient)
❌ NEVER use `python manage.py runserver` in production — it's single-threaded,
insecure, and not built for load. Use Gunicorn (WSGI) or Uvicorn (ASGI for async).
