0

Will the django itself not serve the REST calls from web server (Nginx). Why is Gunicorn required if django itself could do that.

vinod kumar
  • 427
  • 1
  • 4
  • 5

1 Answers1

0

By "django itself" I assume you mean the development server? The basic answer is that the development server is just for development and Gunicorn is a production ready HTTP server that interfaces very nicely with Python/Django.

You could run Gunicorn without Nginx, for example. Nginx is added in addition mostly to serve static files and/or manage incoming requests, relieving the strain on the Gunicorn application server.

See this write up for a very good description of the Gunicorn + Nginx combo: https://www.digitalocean.com/community/tutorials/how-to-deploy-python-wsgi-apps-using-gunicorn-http-server-behind-nginx.