Difference between run_wsgi_app and wsgiref.handlers.CGIHandler

I am just learning how to use python and GAE, and I noticed that the main URL handler is shown in two different ways. What is the difference when calling run_wsgi_app vs wsgiref.handlers.CGIHandler? I saw an example of code shown in both ways.

application = webapp.WSGIApplication( [ ('/', MainPage), ('/sign', Guestbook) ], debug = True) wsgiref.handlers.CGIHandler().run(application) 

vs

 application = webapp.WSGIApplication( [ ('/', MainPage), ('/sign', Guestbook) ], debug = True) def main(): run_wsgi_app(application) 
+4
source share
1 answer

run_wsgi_app is the one you should use. Among other things, it runs any middleware defined in appengine_config.py . The CGIHandler input CGIHandler dates to run_wsgi_app . There should not be any examples of this in the documentation - where did you find it?

+3
source

All Articles