Is wsgi ready for prime time?

Discussion in 'Python' started by Ron Garret, May 17, 2007.

  1. Ron Garret

    Ron Garret Guest

    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
     
    Ron Garret, May 17, 2007
    #1
    1. Advertising

  2. Ron Garret

    Stargaming Guest

    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.
     
    Stargaming, May 17, 2007
    #2
    1. Advertising

  3. On May 17, 8:09 pm, 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



    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
     
    Michele Simionato, May 17, 2007
    #3
  4. Ron Garret

    Ron Garret Guest

    In article <f2i6cr$20vn$>,
    Stargaming <> wrote:

    > 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
     
    Ron Garret, May 17, 2007
    #4
  5. Michele Simionato schrieb:
    > On May 17, 8:09 pm, 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
    >>

    >
    >
    > 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.
     
    Stefan Sonnenberg-Carstens, May 17, 2007
    #5
  6. 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/
     
    Rob Williscroft, May 17, 2007
    #6
  7. 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
     
    Josiah Carlson, May 17, 2007
    #7
  8. On May 18, 5:31 am, Stefan Sonnenberg-Carstens
    <> wrote:
    > 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
     
    Graham Dumpleton, May 17, 2007
    #8
  9. On May 18, 5:31 am, Stefan Sonnenberg-Carstens
    <> wrote:
    > 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
     
    Graham Dumpleton, May 18, 2007
    #9
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    702
  2. CMM

    VS2005 Not ready for prime time

    CMM, Feb 8, 2006, in forum: ASP .Net
    Replies:
    11
    Views:
    710
    Kevin Spencer
    Feb 9, 2006
  3. Joenco
    Replies:
    2
    Views:
    755
    Joenco
    Jul 3, 2003
  4. Jeremy Fischer
    Replies:
    0
    Views:
    220
    Jeremy Fischer
    Jan 16, 2005
  5. Replies:
    5
    Views:
    375
    Bader Senussi Z
    Nov 10, 2012
Loading...

Share This Page