Пример #1
0
    def run(self, bare=False):
        """Runs the app using ``google.appengine.ext.webapp.util.run_wsgi_app``.
        This is generally called inside a ``main()`` function of the file
        mapped in *app.yaml* to run the application::

            # ...

            app = WSGIApplication([
                Route(r'/', HelloWorldHandler),
            ])

            def main():
                app.run()

            if __name__ == '__main__':
                main()

        :param bare:
            If True, uses ``run_bare_wsgi_app`` instead of ``run_wsgi_app``,
            which doesn't add WSGI middleware.
        """
        # Fix issue #772.
        if self.debug:
            fix_sys_path()

        if bare:
            run_bare_wsgi_app(self)
        else:
            run_wsgi_app(self)
Пример #2
0
    def run(self, bare=False):
        """Runs the app using ``google.appengine.ext.webapp.util.run_wsgi_app``.
        This is generally called inside a ``main()`` function of the file
        mapped in *app.yaml* to run the application::

            import webapp2

            app = webapp2.WSGIApplication([
                webapp2.Route(r'/', 'handlers.HelloWorldHandler'),
            ])

            def main():
                app.run()

            if __name__ == '__main__':
                main()

        :param bare:
            If True, uses ``run_bare_wsgi_app`` instead of ``run_wsgi_app``,
            which doesn't add WSGI middleware.
        """
        if bare:
            util.run_bare_wsgi_app(self)
        else:
            util.run_wsgi_app(self)
Пример #3
0
    def run(self, bare=False):
        """Runs the app using ``google.appengine.ext.webapp.util.run_wsgi_app``.
        This is generally called inside a ``main()`` function of the file
        mapped in *app.yaml* to run the application::

            # ...

            app = WSGIApplication([
                Route(r'/', HelloWorldHandler),
            ])

            def main():
                app.run()

            if __name__ == '__main__':
                main()

        :param bare:
            If True, uses ``run_bare_wsgi_app`` instead of ``run_wsgi_app``,
            which doesn't add WSGI middleware.
        """
        if bare:
            run_bare_wsgi_app(self)
        else:
            run_wsgi_app(self)
Пример #4
0
def main():
    """Called by App Engine for incoming requests.

    Since this handler script defines a function named main(), then the script and
    its global environment will be cached like an imported module. The first
    request for the script on a given web server evaluates the script normally.
    For subsequent requests, App Engine calls the main() function in the cached
    environment.
    """
    # Use GAE helper function to run the WSGI app.
    run_bare_wsgi_app(wsgi_app)
Пример #5
0
def main():
    """The main function."""

    app = webapp.WSGIApplication([
        ('.*/static/.*', StaticHandler),
        ('.*/records.*', AJAXRecordsHandler),
        ('.*/browse.*', BrowserHandler),
        ('.*', OverviewHandler),
    ], debug=True)

    util.run_bare_wsgi_app(app)
Пример #6
0
def main():
    """The main function."""

    app = webapp.WSGIApplication([
        ('.*/static/.*', StaticHandler),
        ('.*/records.*', AJAXRecordsHandler),
        ('.*/browse.*', BrowserHandler),
        ('.*', OverviewHandler),
    ],
                                 debug=True)

    util.run_bare_wsgi_app(app)
Пример #7
0
def main():
  """Main program.  Auth check, then create and run the WSGIApplication."""
  if not os.getenv('SERVER_SOFTWARE', '').startswith('Dev'):
    if not users.is_current_user_admin():
      if users.get_current_user() is None:
        print 'Status: 302'
        print 'Location:', users.create_login_url(os.getenv('PATH_INFO', ''))
      else:
        print 'Status: 403'
        print
        print 'Forbidden'
      return
  app = webapp.WSGIApplication(URLMAP, debug=DEBUG)
  util.run_bare_wsgi_app(app)
Пример #8
0
def main():
    """Main program. Run the auth checking middleware wrapped WSGIApplication."""
    util.run_bare_wsgi_app(app)
Пример #9
0
def main():
  """Main program. Run the auth checking middleware wrapped WSGIApplication."""
  util.run_bare_wsgi_app(app)
Пример #10
0
def main():
    util.run_bare_wsgi_app(application)
Пример #11
0
def main():
    util.run_bare_wsgi_app(app)
Пример #12
0
def main():
  util.run_bare_wsgi_app(app)
Пример #13
0
def main():
    run_bare_wsgi_app(wsgi_app)
Пример #14
0
def main():
    run_bare_wsgi_app(wsgi_app)
Пример #15
0
def main():
  util.run_bare_wsgi_app(application)
Пример #16
0
 def run_appengine(self, bare=False):
   run_bare_wsgi_app(self)