Νίκος Αλεξόπουλος <nikos.gr...@gmail.com> writes:

> i use 'cgi', but i noticed you used 'mod-wsgi'.
> I want to ask you why you chose the latter? Is the latter better than
> the former?
>
> Is it faster? Does it bahave the same way?
> I my code works works with cgi, which it does, will the same code works
> with mod-wcgi?

You probably mean mod-wsgi. It is faster than CGI because it doesn't have to 
start a new Python interpreter for each request. And the protocol it uses is 
different so you should rewrite your scripts if you want to use WSGI. There are 
bridges to use your CGI script within WSGI, but it needs care; you cannot use 
it for every CGI script - your script has to work in a certain way (like being 
careful with initializing everything everytime it runs). That said, you can use 
both at the same time in a web server: some CGI scripts and some WSGI, and 
convert them one after one if you think it is necessary. For example a script 
that is seldom used can stay as CGI script.

And last but not least: not every Apache installation has mod-wsgi enabled. I 
think most hosting providers don't.
-- 
Piet van Oostrum <p...@vanoostrum.org>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to