1

我需要使用 NginX 还是可以在没有它的情况下托管它?

我正在开发我的第一个 django 项目,并且可以使用以下命令运行应用程序项目:

./manage.py run_gunicorn -c config/gunicorn

然后我可以查看它:

http://127.0.0.1:8000/resources/

我现在想尝试托管它,以便其他 PC 可以访问它。

4

3 回答 3

2

Gunicorn 是 wsgi http 服务器。最好在 HTTP 代理服务器后面使用 Gunicorn。我们强烈建议您使用 nginx。

@ http://gunicorn.org/#deployment

尽管有许多 HTTP 代理可用,但我们强烈建议您使用 Nginx。如果您选择另一个代理服务器,则需要确保在使用默认 Gunicorn 工作程序时它缓冲慢速客户端。如果没有这种缓冲,Gunicorn 很容易受到拒绝服务攻击。

@ http://docs.gunicorn.org/en/latest/deploy.html

于 2013-02-12T08:38:24.410 回答
0

不需要前端代理;您可以将像 gunicorn 这样的独立网络服务器直接投入生产。但是无论如何,您可能还是要使用前端网络服务器有多种原因。

于 2013-02-08T02:46:21.800 回答
-1

当然不是。您可以使用 lighttpd 或任何其他支持 WSGI、SCGI、FastCGI 或 AJP 的 Web 服务器。你可以参考这个python 文档django 文档,以及 stackoverflow 上的这两个问题:Cleaest & Fastest server setup for DjangoDifferences and uses between WSGI, CGI, FastCGI, and mod_python 在 Python 方面?可能也有帮助。

于 2013-02-08T02:17:32.633 回答