Is wsgi ready for prime time?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ron Garret

    #1

    Is wsgi ready for prime time?

    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
  • Stargaming

    #2
    Re: Is wsgi ready for prime time?

    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(wsgire f)
    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.

    Comment

    • Michele Simionato

      #3
      Re: Is wsgi ready for prime time?

      On May 17, 8:09 pm, Ron Garret <rNOSPA...@flow net.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.>>i mport 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

      Comment

      • Ron Garret

        #4
        Re: Is wsgi ready for prime time?

        In article <f2i6cr$20vn$1@ ulysses.news.ti scali.de>,
        Stargaming <stargaming@gma il.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(wsgire f)
        ['__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(wsgire f)
        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.uti l
        Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        AttributeError: 'module' object has no attribute 'util'
        >>wsgiref.heade rs
        Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        AttributeError: 'module' object has no attribute 'headers'
        >>wsgiref.handl ers
        Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        AttributeError: 'module' object has no attribute 'handlers'
        >>>
        Hence my question.

        rg

        Comment

        • Stefan Sonnenberg-Carstens

          #5
          Re: Is wsgi ready for prime time?

          Michele Simionato schrieb:
          On May 17, 8:09 pm, Ron Garret <rNOSPA...@flow net.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.>>i mport 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.

          Comment

          • Rob Williscroft

            #6
            Re: Is wsgi ready for prime time?

            Ron Garret wrote in news:rNOSPAMon-B77D6B.12263417 052007
            @news.gha.chart ermi.net in comp.lang.pytho n:
            >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.ut il
            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.uti l
            <module 'wsgiref.util' from '....\Python25\ lib\wsgiref\uti l.pyc'>
            >>>
            Rob.
            --

            Comment

            • Josiah Carlson

              #7
              Re: Is wsgi ready for prime time?

              Ron Garret wrote:
              >>>wsgiref.ut il
              Traceback (most recent call last):
              File "<stdin>", line 1, in <module>
              AttributeError: 'module' object has no attribute 'util'
              >>>wsgiref.head ers
              Traceback (most recent call last):
              File "<stdin>", line 1, in <module>
              AttributeError: 'module' object has no attribute 'headers'
              >>>wsgiref.hand lers
              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.uti l
              Traceback (most recent call last):
              File "<stdin>", line 1, in <module>
              AttributeError: 'module' object has no attribute 'util'
              >>import wsgiref.util
              >>wsgiref.uti l
              <module 'wsgiref.util' from 'c:\python25\li b\wsgiref\util. pyc'>
              >>>
              It's almost magic.

              - Josiah

              Comment

              • Graham Dumpleton

                #8
                Re: Is wsgi ready for prime time?

                On May 18, 5:31 am, Stefan Sonnenberg-Carstens
                <stefan.sonnenb ...@pythonmeist er.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

                Comment

                • Graham Dumpleton

                  #9
                  Re: Is wsgi ready for prime time?

                  On May 18, 5:31 am, Stefan Sonnenberg-Carstens
                  <stefan.sonnenb ...@pythonmeist er.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

                  Comment

                  Working...