gunicorn如何更好地部署Django?

2024-06-02 06:11:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我在用nginx和gunicorn和django。我想知道

问:与单独使用django的runserver相比,使用gunicorn有什么好处


Tags: djangonginxgunicornrunserver
1条回答
网友
1楼 · 发布于 2024-06-02 06:11:33

https://docs.djangoproject.com/en/2.2/ref/django-admin/#runserver

django-admin runserver [addrport]

Starts a lightweight development Web server on the local machine.

...

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还可以创建多个worker来监听同一个socket,这使得web应用程序能够并行地服务HTTP请求

相关问题 更多 >