[cse491] init class Server with a WSGI app

C. Titus Brown ctb at msu.edu
Mon Oct 19 18:22:30 PDT 2009


On Mon, Oct 19, 2009 at 09:11:06PM -0400, kellyry7 at msu.edu wrote:
> Ok. see that's what I thought. But how is the app being passed in if you just call python webserve.py <port>?

You should rewrite your form procesing code so that it is a WSGI app, and 
have that be the "default" app used in your __main__ code.  Does that help?

cheers,
--titus

> 
> Quoting "C. Titus Brown" <ctb at msu.edu>:
> 
> > On Mon, Oct 19, 2009 at 07:46:29PM -0400, Ryan Kelly wrote:
> >> ? ? ? ? I've got everything working but it completely bypasses the use of app
> >> in the definition of the Server object. I'm not really sure how we were
> >> supposed to use that. Could you explain it? If you need my code context
> >> it is committed to trunk along with my redone jinja2_form.py. Thanks
> >
> > Hi Ryan,
> >
> > somewhere in whatever your equivalent is of my parse_request function
> > you want to call 'self.app(environ, start_response)' in order to
> > start generating content.
> >
> > So, set self.app equal to the passed in app object for the Server class
> > constructor, and then just retrieve it and use it in the parse_request
> > fn.
> >
> > cheers,
> > --titus
> > --
> > C. Titus Brown, ctb at msu.edu
> >
> >
-- 
C. Titus Brown, ctb at msu.edu



More information about the cse491-fall-2009 mailing list