Is gunicorn required for django to serve REST?

2k Views Asked by At

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

1

There are 1 best solutions below

1
On

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.