带和不带 Nginx 的 Django

标签 django nginx uwsgi

我正在使用 Django 在 Linux 服务器上开发 Web 应用程序。

在部署方面,一个建议的方式是使用Nginx与客户端通信,Django只需要与Nginx通信使用 uwsgi 协议(protocol)。

关系是client<-Http->Nginx<-uwsgi->Django server

后来我发现我也可以用

在公共(public)网络上推送服务器

python manage.py runserver 0:0:0:0

Nginx 似乎可以帮助提供静态文件和媒体。

我的问题是,使用 Nginx 作为中间人到底有什么好处?

最佳答案

来自docs on runserver :

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.)

关于带和不带 Nginx 的 Django,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49293525/

相关文章:

wordpress - varnish nginx wordpress ssl 几个域

python - 保存时忽略内联模型

Django 数据库错误 : relation "django_site"

django - django 项目中拒绝 docker 权限的 bash 脚本

deployment - node.js部署问题

java - 当执行到 Tomcat 的 proxy_pass 时,Nginx 如何将子域添加为参数

nginx - 带有 nginx + uwsgi 的 Django

python - 使用 uWSGI 在 nginx 下部署的 Flask 在哪里获取我的 Python 打印件?

django - Uwsgi禁用django.request日志记录

python - Django 开发的 Virtualenv,最好在项目或应用程序级别?