Why do we need to deploy Django with gunicorn?

Viewed 1080

We can simply start a Django server1 with python manage.py runserver 8080, so why do we need to deploy Django server2 like gunicorn myproject.wsgi? I googled about wsgi, it says that wsgi connects between nginx and Django, but what confused me is that we can make http requests(like with postman) to server1 and everything works well. So what's the difference?

2 Answers

From django runserver documentation:

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 the Django Docs says:

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

So, its clear for what reason we need to use Gunicorn or other similar tools to deploy it.

Related