为什么我们需要用gunicorn部署Django?

Why do we need to deploy Django with gunicorn?

我们可以简单地用 python manage.py runserver 8080 启动一个 Django server1,那么为什么我们需要像 gunicorn myproject.wsgi 一样部署 Django server2?我在谷歌上搜索了 wsgi,它说 wsgi 连接在 nginx 和 Django 之间,但让我感到困惑的是我们可以向 server1 发出 http 请求(比如邮递员)并且一切正常。那有什么区别呢?

来自 django runserver documentation:

DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. (And that’s how it’s gonna stay. We’re in the business of making Web frameworks, not Web servers, so improving this server to be able to handle a production environment is outside the scope of Django.)

正如 Django 文档所说:

DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through security audits or performance tests. (And that’s how it’s gonna stay. We’re in the business of making Web frameworks, not Web servers, so improving this server to be able to handle a production environment is outside the scope of Django.)

那么,为什么我们需要使用 Gunicorn 或其他类似工具来部署它就很清楚了。