By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

Is wsgi ready for prime time?

P: n/a
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
May 17 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Ron Garret wrote:
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.
May 17 '07 #2

P: n/a
On May 17, 8:09 pm, Ron Garret <rNOSPA...@flownet.comwrote:
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,
so those are the first options I would consider. But you could post on
the WSGI list for more.

Michele Simionato

May 17 '07 #3

P: n/a
In article <f2***********@ulysses.news.tiscali.de>,
Stargaming <st********@gmail.comwrote:
Ron Garret wrote:
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.:
>>wsgiref.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'util'
>>wsgiref.headers
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'headers'
>>wsgiref.handlers
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'handlers'
>>>
Hence my question.

rg
May 17 '07 #4

P: n/a
Michele Simionato schrieb:
On May 17, 8:09 pm, Ron Garret <rNOSPA...@flownet.comwrote:
>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.
May 17 '07 #5

P: n/a
Ron Garret wrote in news:rNOSPAMon-B77D6B.12263417052007
@news.gha.chartermi.net in comp.lang.python:
>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.:
>>>wsgiref.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'util'
IDLE 1.2
>>import wsgiref.util
wsgiref.util
<module 'wsgiref.util' from '....\Python25\lib\wsgiref\util.pyc'>
>>>
Rob.
--
http://www.victim-prime.dsl.pipex.com/
May 17 '07 #6

P: n/a
Ron Garret wrote:
>>>wsgiref.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'util'
>>>wsgiref.headers
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'headers'
>>>wsgiref.handlers
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.
>>import wsgiref
wsgiref.util
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'util'
>>import wsgiref.util
wsgiref.util
<module 'wsgiref.util' from 'c:\python25\lib\wsgiref\util.pyc'>
>>>
It's almost magic.

- Josiah
May 17 '07 #7

P: n/a
On May 18, 5:31 am, Stefan Sonnenberg-Carstens
<stefan.sonnenb...@pythonmeister.comwrote:
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

May 17 '07 #8

P: n/a
On May 18, 5:31 am, Stefan Sonnenberg-Carstens
<stefan.sonnenb...@pythonmeister.comwrote:
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

May 17 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.