Search code examples
pythondjangonetwork-programmingserverwsgi

Should you deploy django with wsgi?


Do you need to deploy django with wsgi? I am running Django on a Docker instance and it seems like often the recommended solution is just to use Django's development server, i.e. the command python manage.py runserver. When exactly is a web server such as wsgi needed -- and in this instance, in a containerized application, is the django development server enough for production applications?


Solution

  • You answer your own question:

    is the django development server enough for production applications ?

    In the django documentation, you can read the following:

    Now’s a good time to note: don’t use this server in anything resembling a production environment. It’s intended only for use while developing. (We’re in the business of making Web frameworks, not Web servers.)

    And also this part:

    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 no. Don't use the Django development server in production. Security risks, poor performances, etc.