简体   繁体   English

用Nginx和Apache设置django

[英]setting up django with nginx and apache

I just started developing in Django a few days back. 几天前,我才刚刚开始在Django中进行开发。 After finishing a few applications I read that Django is best served using nginx for static content and a reverse proxy to apache for dynamic contents. 完成一些应用程序后,我读到Django最适合使用nginx静态内容和反向代理apache的动态内容。 Is there a particular reason that this configuration preferred over any other? 是否有特定原因导致此配置优于其他配置?

Also, although this seems to be the standard approach I havent yet been able to find a proper tutorial or document that walks through such a configuration. 而且,尽管这似乎是标准方法,但我还没有找到可以进行这种配置的适当教程或文档。 Most seem to be incomplete/non-working. 大多数似乎不完整/不起作用。

It would be great if someone could explain to me how this is to be done or point in the right direction or maybe link a tutorial here. 如果有人可以向我解释这是怎么做的,或者指出正确的方向,或者可以在此处链接教程,那将是很棒的。

Thanks in advance. 提前致谢。

I suggest to use nginx and gunicorn/uwsgi configuration, it more common this days and easier to setup/configure that apache. 我建议使用nginx和gunicorn / uwsgi配置,这在当今更为普遍,并且更容易设置/配置该Apache。 A proper tutorials can be found here: 可以在这里找到合适的教程:

1) django + gunicorn and a more complete tutorial with supervisor, fabric here 1) django + gunicorn以及有关主管的更完整教程,请点击这里

2) django + uwsgi 2) Django + uwsgi

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM