How to use the wsgiref.handlers function in wsgiref

To help you get started, we’ve selected a few wsgiref examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gtracy / SMSMyBus / crawl / load_gtfs.py View on Github external
def main():
  logging.getLogger().setLevel(logging.DEBUG)
  application = webapp.WSGIApplication([('/gtfs/port/stops', PortStopsHandler),
                                        ('/gtfs/port/stop/task/', PortStopTask),
                                        ],
                                       debug=True)
  wsgiref.handlers.CGIHandler().run(application)
github bruntonspall / uksnow / main.py View on Github external
def main():
  application = webapp.WSGIApplication([
        ('/', MainHandler),
        ('/georss', GeoRSSHandler),
        ('/geojson', GeoJSONHandler),
        ('/kml', GeoKMLHandler),
        ],    debug=True)
  wsgiref.handlers.CGIHandler().run(application)
github mozilla-services / socorro / thirdparty / web / application.py View on Github external
def cgirun(self, *middleware):
        """
        Return a CGI handler. This is mostly useful with Google App Engine.
        There you can just do:

            main = app.cgirun()
        """
        wsgiapp = self.wsgifunc(*middleware)

        try:
            from google.appengine.ext.webapp.util import run_wsgi_app
            return run_wsgi_app(wsgiapp)
        except ImportError:
            # we're not running from within Google App Engine
            return wsgiref.handlers.CGIHandler().run(wsgiapp)
github blixt / multifarce / app / admin.py View on Github external
def main():
    application = webapp.WSGIApplication([
        ('/admin/upgrade', UpgradeHandler),
        ('/admin/setup', SetupHandler),
    ])
    wsgiref.handlers.CGIHandler().run(application)
github progrium / scriptlets / site / main.py View on Github external
def main():
    application = webapp.WSGIApplication([
        ('/', RootHandler),
        ('/new', NewHandler),
        ('/.*', ScriptHandler),
        ], debug=True)
    wsgiref.handlers.CGIHandler().run(application)
github benhedrington / activity-streams / main.py View on Github external
def main():
  wsgiref.handlers.CGIHandler().run(application)
github GoogleCloudPlatform / python-compat-runtime / google / appengine / ext / vmruntime / meta_app.py View on Github external
def _StubWSGIUtils(output_app_holder):
  """Stub out WSGI adapters for python 2.5."""
  stubs = _StubOut()
  stubbed_wsgi_handler_class = (
      lambda * args, **kwargs: _MockedWsgiHandler(output_app_holder))

  def RunWSGIStub(application):
    output_app_holder.append(application)

  stubs.Set(webapp_util, 'run_bare_wsgi_app', RunWSGIStub)
  stubs.Set(webapp_util, 'run_wsgi_app', RunWSGIStub)



  stubs.Set(handlers, 'BaseHandler', stubbed_wsgi_handler_class)
  stubs.Set(handlers, 'SimpleHandler', stubbed_wsgi_handler_class)
  stubs.Set(handlers, 'BaseCGIHandler', stubbed_wsgi_handler_class)
  stubs.Set(handlers, 'CGIHandler', stubbed_wsgi_handler_class)


  return stubs.CleanUp
github rjernst / calvary-website / school / urls.py View on Github external
def main():
  wsgiref.handlers.CGIHandler().run(_application)