[Django]-Django with and without Nginx

4👍

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

1👍

runserver is for debugging, in production we use gunicorn/uwsgi to boot the django app, so the question can be Do we need Nginx if we have configured gunicorn/uwsgi for Django, the answer is YES, becuase compared with gunicorn/uwsgi, Nginx has following advantages
:

  • security, it can be configured to deny or allow certain ip addresses
  • load balancing
  • handle static files
  • cache

refer to more features: https://en.wikipedia.org/wiki/Nginx#HTTP_proxy_and_Web_server_features

Leave a comment