request.env is the web2py environment

request.wsgi.environ is the environment you want (created by web2py
for your app). It has wsgi.input.



On Oct 31, 9:32 am, hcvst <[email protected]> wrote:
> Hi Massimo,
>
> thanks, this makes wsgi a lot easier - there are a few issues however:
>
> 1. environ['wsgi.input'] does not seem to exist - there is however
> request.env.wsgi_input.
> 2. Not sure what the wsgi spec says but one has to call seek(0) on
> wsgi_input to 'rewind' the buffer when
> using Google's webapp for example as Google does not call getvalue()
> but read() to get the buffer contents.
> 3. The lamda your start_response returns also appears to write to
> response.body - Again I am not sure
> what the wsgi specs say but usually the call to app(env,
> start_response) returns a generator one calls to
> get the contents. Google's webapp works nicely with the
> response.body.write method though.
>
> HC
>
> On Oct 31, 1:24 am, mdipierro <[email protected]> wrote:
>
> > It fixes some problems introduced by new features in 1.69.1.
>
> > It also includes:
> > - db(...).select().as_dict()
> > - Experimental distributed transactions with mysql, postgresql and
> > firebird
> > - Improved validators
> > - ability to call wsgi apps from actions
>
> >     def index():
> >         return somewsgiapp
> > (request.wsgi.environ,request.wsgi.start_response)
>
> > and to apply wsgi middleware to normal web2py actions
>
> >     @request.wsgi.middleware(somewsgimiddleware,someother)
> >     def index(): return 'hello world'
>
> > Please report any error.
>
> > Thanks to Mr Freeze, Thadeus and Jonathan for help.
>
> > Happy Halloween to everybody.
>
> > Massimo
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to