Software Enthusiastic
Software Enthusiastic

Reputation: 26425

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.

Upvotes: 7

Views: 1196

Answers (3)

S.Lott
S.Lott

Reputation: 391820

We tried mod_python. It's slower and harder to configure. It doesn't offer the daemon feature.

We couldn't get fast_cgi built for our combination of Apache, Red Hat and Python. I'm not sure specifically what was wrong, but we couldn't get it built properly. It wouldn't dispatch requests to Django properly, and we couldn't diagnose the problem.

We tried mod_wsgi third. It built nicely. It has the daemon option. It's very easy to configure. It allows trivial restart of the Django applications without restarting all of Apache.

Upvotes: 5

Josh Wright
Josh Wright

Reputation: 2505

I use mod_wsgi for any production Django app. It's fast, stable, and very configurable.

You may also want to look in to the FastCGI method a bit more. Eric Florenzano just did a great write up of Django with FastCGI for the Django Advent: http://djangoadvent.com/1.2/deploying-django-site-using-fastcgi/

Upvotes: 0

Alex Martelli
Alex Martelli

Reputation: 881477

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.

Upvotes: 15

Related Questions