Search code examples
pythondjangomod-wsgiwsgidjango-wsgi

It is said best way to deploy django is using wsgi, I am wondering why?


We are deploying django application, I found in the documentation that it is recommended to use WSGI appoach for doing that.

Before deploying I wanted to know, why it is recommended over other two approaches i.e. using mod_python and fastcgi...

Thanks a lot.


Solution

  • wsgi is usually preferred because it decouples your choice of framework from your choice of web server: if tomorrow you want to move, say, from Apache to nginx, or whatever, the move is trivially easy with wsgi, not so easy otherwise.

    Furthermore, using wsgi affords you the option to add some middleware that's framework-independent, rather than having to rely on every possible functionality you want having already been implemented and made available for your framework of choice.