Is wsgi ready for prime time?

R

Ron Garret

The wsgiref module in Python 2.5 seems to be empty:

[ron@mickey:~/Sites/modpy]$ python
Python 2.5 (r25:51908, Mar 1 2007, 10:09:05)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import wsgiref
dir(wsgiref) ['__builtins__', '__doc__', '__file__', '__name__', '__path__']

So... is wsgi considered ready for production use, or is it still on the
bleeding edge? And if the former, which implementation should one use?

rg
 
S

Stargaming

Ron said:
The wsgiref module in Python 2.5 seems to be empty:

[ron@mickey:~/Sites/modpy]$ python
Python 2.5 (r25:51908, Mar 1 2007, 10:09:05)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

['__builtins__', '__doc__', '__file__', '__name__', '__path__']


So... is wsgi considered ready for production use, or is it still on the
bleeding edge? And if the former, which implementation should one use?

rg
Help on package wsgiref:

NAME
wsgiref - wsgiref -- a WSGI (PEP 333) Reference Library

DESCRIPTION
Current Contents:

* util -- Miscellaneous useful functions and wrappers

* headers -- Manage response headers

* handlers -- base classes for server/gateway implementations

* simple_server -- a simple BaseHTTPServer that supports WSGI

* validate -- validation wrapper that sits between an app and a server
to detect errors in either

To-Do:

* cgi_gateway -- Run WSGI apps under CGI (pending a deployment
standard)

* cgi_wrapper -- Run CGI apps under WSGI

* router -- a simple middleware component that handles URL traversal

PACKAGE CONTENTS
handlers
headers
simple_server
util
validate

Reading the documentation can be useful sometimes. Recommending
http://docs.python.org/lib/module-wsgiref.html, too.
 
M

Michele Simionato

The wsgiref module in Python 2.5 seems to be empty:

[ron@mickey:~/Sites/modpy]$ python
Python 2.5 (r25:51908, Mar 1 2007, 10:09:05)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>> import wsgiref
['__builtins__', '__doc__', '__file__', '__name__', '__path__']



So... is wsgi considered ready for production use, or is it still on the
bleeding edge? And if the former, which implementation should one use?

rg


Try help(wsgiref).

I would say that WSGI (the spec) is ready for production use whereas
wsgiref
(the implementation in the standard library) is intended for easy
development
and testing purposes, not for industrial strenght deployement. On the
other hand Zope 3 uses Twisted via WSGI as a business class server,
and I hear that mod_wsgi is slightly more performant than mod_python,
so those are the first options I would consider. But you could post on
the WSGI list for more.

Michele Simionato
 
R

Ron Garret

Stargaming said:
Ron said:
The wsgiref module in Python 2.5 seems to be empty:

[ron@mickey:~/Sites/modpy]$ python
Python 2.5 (r25:51908, Mar 1 2007, 10:09:05)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import wsgiref
dir(wsgiref)

['__builtins__', '__doc__', '__file__', '__name__', '__path__']


So... is wsgi considered ready for production use, or is it still on the
bleeding edge? And if the former, which implementation should one use?

rg
help(wsgiref)
Help on package wsgiref:

NAME
wsgiref - wsgiref -- a WSGI (PEP 333) Reference Library

DESCRIPTION
Current Contents:

* util -- Miscellaneous useful functions and wrappers

* headers -- Manage response headers

* handlers -- base classes for server/gateway implementations

* simple_server -- a simple BaseHTTPServer that supports WSGI

* validate -- validation wrapper that sits between an app and a server
to detect errors in either

To-Do:

* cgi_gateway -- Run WSGI apps under CGI (pending a deployment
standard)

* cgi_wrapper -- Run CGI apps under WSGI

* router -- a simple middleware component that handles URL traversal

PACKAGE CONTENTS
handlers
headers
simple_server
util
validate

Reading the documentation can be useful sometimes. Recommending
http://docs.python.org/lib/module-wsgiref.html, too.

I did read the documentation, but the documentation does not seem to
reflect reality, e.g.:
Traceback (most recent call last):
Traceback (most recent call last):
Traceback (most recent call last):

Hence my question.

rg
 
S

Stefan Sonnenberg-Carstens

Michele said:
The wsgiref module in Python 2.5 seems to be empty:

[ron@mickey:~/Sites/modpy]$ python
Python 2.5 (r25:51908, Mar 1 2007, 10:09:05)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>> import wsgiref
dir(wsgiref)
['__builtins__', '__doc__', '__file__', '__name__', '__path__']



So... is wsgi considered ready for production use, or is it still on the
bleeding edge? And if the former, which implementation should one use?

rg


Try help(wsgiref).

I would say that WSGI (the spec) is ready for production use whereas
wsgiref
(the implementation in the standard library) is intended for easy
development
and testing purposes, not for industrial strenght deployement. On the
other hand Zope 3 uses Twisted via WSGI as a business class server,
and I hear that mod_wsgi is slightly more performant than mod_python,
It is not only _slightly_ faster. It is a beast.
so those are the first options I would consider. But you could post on
the WSGI list for more.

Michele Simionato
IMHO WSGI is _only_ a new way of talking to webservers, like apache.
It is as low-level as (f)cgi, so don't expect too much support at this
stage -
indeed a module like the cgi one in the std lib would be nice.
As google uses it (mod_wsgi), I would suspect you can use it.
 
R

Rob Williscroft

Ron Garret wrote in @news.gha.chartermi.net in comp.lang.python:
I did read the documentation, but the documentation does not seem to
reflect reality, e.g.:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'util'

IDLE 1.2
Rob.
 
J

Josiah Carlson

Ron said:
Traceback (most recent call last):

Traceback (most recent call last):

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'handlers'

wsgiref is a package. In order to access submodules/packages, you must
import them.
Traceback (most recent call last):

It's almost magic.

- Josiah
 
G

Graham Dumpleton

IMHO WSGI is _only_ a new way of talking to webservers, like apache.
It is as low-level as (f)cgi, so don't expect too much support at this
stage -
indeed a module like the cgi one in the std lib would be nice.
As google uses it (mod_wsgi), I would suspect you can use it.

So people don't get the wrong impression, mod_wsgi is merely hosted on
the Google code site. This does not mean that Google uses it, nor does
Google have anything to do with its development.

Graham
 
G

Graham Dumpleton

IMHO WSGI is _only_ a new way of talking to webservers, like apache.
It is as low-level as (f)cgi, so don't expect too much support at this
stage -
indeed a module like the cgi one in the std lib would be nice.
As google uses it (mod_wsgi), I would suspect you can use it.

So people don't get the wrong impression, mod_wsgi is merely hosted on
the Google code site. This does not mean that Google uses it, nor does
Google have anything to do with its development.

Graham
 

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

No members online now.

Forum statistics

Threads
474,171
Messages
2,570,935
Members
47,472
Latest member
KarissaBor

Latest Threads

Top