Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django with and without Nginx

I am using Django to develop a web application on the linux server.

When it comes to deployment, a proposed way is to use Nginx to communicate with the client and Django only need to communicate with Nginx with uwsgi protocol.

The relationship is client<-Http->Nginx<-uwsgi->Django server

Latter I found that I can also push the server on public network with

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

It seems that the Nginx can help serve the static file and media.

My question is, what is exactly the benefit of using Nginx as the middleman?

like image 601
Kicr Avatar asked Dec 14 '25 18:12

Kicr


1 Answers

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

like image 72
Daniel Roseman Avatar answered Dec 16 '25 22:12

Daniel Roseman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!