CGI vs WSGI

T

tuom.larsen

Dear all,

what is the difference? Middleware?

I'm wondering because the only variables I ever needed were PATH_INFO,
REQUEST_METHOD, QUERY_STRING and maybe one more, all of which should
be available from CGI, too.

Thanks.
 
M

Michele Simionato

Dear all,

what is the difference? Middleware?

Yes, and also the fact that you have a large choice of WSGI web
frameworks to choose
from. CGI looks so much 20th century ... ;)


Michele Simionato
 
J

Josiah Carlson

I'm wondering because the only variables I ever needed were PATH_INFO,
REQUEST_METHOD, QUERY_STRING and maybe one more, all of which should
be available from CGI, too.

CGI starts up a new process for every request, using stdin/stdout for
passing information. I believe WSGI can do that, but I believe it can
also do in-process requests (think mod_python, only with a Python web
server), external process requests (think FastCGI or LRWP), etc.

I could certainly be mistaken, it's been a while since I looked into any
of it.

- Josiah
 
B

Bruno Desthuilliers

(e-mail address removed) a écrit :
Dear all,

what is the difference? Middleware?

I'm wondering because the only variables I ever needed were PATH_INFO,
REQUEST_METHOD, QUERY_STRING and maybe one more, all of which should
be available from CGI, too.

Thanks.

WSGI is intented as a gateway between a web server and a long-running
python application. Which means you don't have to launch a new Python
interpreter, import libs, parse config, connect to the database etc etc
for each and every request.

Also, it's (IMHO) much more usable than CGI.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top