I made some changes in trunk that allows you access wsgi directly,
based on your code.Instead of

# Web2py function
def process():

   def start_response(status, headers, exc_info=None):
       http_code, _ = status.split(' ',1)
       if http_code == '200':
           for k,v in headers:
               response.headers[k] = v
       else:
           raise HTTP(http_code)
       return functools.partial(response.write, escape=False)

   environment = dict()
   denormalize = lambda x: x.replace('_', '.', 1) if x.startswith
('wsgi') \
                           else x.upper()
   for k, v in request.env.items():
       environment[denormalize(k)] = v

   app = webapp.WSGIApplication(...)

   app(environment, start_response)
   return response.body.getvalue()


You can now do:

# Web2py function
def process():
   app = webapp.WSGIApplication(...)
   app(request.wsgi.environment, request.wsgi.start_response)
   return response.body.getvalue()

and can call any WSGI app from inside controllers.


On Oct 29, 3:11 am, hcvst <hcv...@googlemail.com> wrote:
> http://www.web2pyslices.com/main/slices/take_slice/17
>
> Still work in progress, but testing locally seems to work.
>
> HC
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to