当前位置: 首页>>代码示例>>Python>>正文


Python util.run_wsgi_app方法代码示例

本文整理汇总了Python中google.appengine.ext.webapp.util.run_wsgi_app方法的典型用法代码示例。如果您正苦于以下问题:Python util.run_wsgi_app方法的具体用法?Python util.run_wsgi_app怎么用?Python util.run_wsgi_app使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在google.appengine.ext.webapp.util的用法示例。


在下文中一共展示了util.run_wsgi_app方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
def main():
  # Run the WSGI CGI handler with that application.
  util.run_wsgi_app(app) 
开发者ID:elsigh,项目名称:browserscope,代码行数:5,代码来源:main.py

示例2: main

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
def main():
  util.run_wsgi_app(APP) 
开发者ID:elsigh,项目名称:browserscope,代码行数:4,代码来源:main.py

示例3: _main

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
def _main():
  webapp_util.run_wsgi_app(_APP) 
开发者ID:elsigh,项目名称:browserscope,代码行数:4,代码来源:handlers.py

示例4: run

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
def run(self, handler):
        from google.appengine.ext.webapp import util
        # A main() function in the handler script enables 'App Caching'.
        # Lets makes sure it is there. This _really_ improves performance.
        module = sys.modules.get('__main__')
        if module and not hasattr(module, 'main'):
            module.main = lambda: util.run_wsgi_app(handler)
        util.run_wsgi_app(handler) 
开发者ID:Autodesk,项目名称:arnold-usd,代码行数:10,代码来源:__init__.py

示例5: cgirun

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
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) 
开发者ID:joxeankoret,项目名称:nightmare,代码行数:17,代码来源:application.py

示例6: run

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
def run(self, handler):
        depr(0, 13, "AppEngineServer no longer required",
             "Configure your application directly in your app.yaml")
        from google.appengine.ext.webapp import util
        # A main() function in the handler script enables 'App Caching'.
        # Lets makes sure it is there. This _really_ improves performance.
        module = sys.modules.get('__main__')
        if module and not hasattr(module, 'main'):
            module.main = lambda: util.run_wsgi_app(handler)
        util.run_wsgi_app(handler) 
开发者ID:brycesub,项目名称:silvia-pi,代码行数:12,代码来源:bottle.py

示例7: gaerun

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
def gaerun(self, *middleware):
        """
        Starts the program in a way that will work with Google app engine,
        no matter which version you are using (2.5 / 2.7)

        If it is 2.5, just normally start it with app.gaerun()

        If it is 2.7, make sure to change the app.yaml handler to point to the
        global variable that contains the result of app.gaerun()

        For example:

        in app.yaml (where code.py is where the main code is located)

            handlers:
            - url: /.*
              script: code.app

        Make sure that the app variable is globally accessible
        """
        wsgiapp = self.wsgifunc(*middleware)
        try:
            # check what version of python is running
            version = sys.version_info[:2]
            major   = version[0]
            minor   = version[1]

            if major != 2:
                raise EnvironmentError("Google App Engine only supports python 2.5 and 2.7")

            # if 2.7, return a function that can be run by gae
            if minor == 7:
                return wsgiapp
            # if 2.5, use run_wsgi_app
            elif minor == 5:
                from google.appengine.ext.webapp.util import run_wsgi_app
                return run_wsgi_app(wsgiapp)
            else:
                raise EnvironmentError("Not a supported platform, use python 2.5 or 2.7")
        except ImportError:
            return wsgiref.handlers.CGIHandler().run(wsgiapp) 
开发者ID:Naayouu,项目名称:Hatkey,代码行数:43,代码来源:application.py

示例8: run

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
def run(self, handler):
        from google.appengine.ext.webapp import util
        util.run_wsgi_app(handler) 
开发者ID:lrq3000,项目名称:pyFileFixity,代码行数:5,代码来源:bottle2.py

示例9: main

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
def main():
  util.run_wsgi_app(app) 
开发者ID:GoogleCloudPlatform,项目名称:datastore-ndb-python,代码行数:4,代码来源:hello.py

示例10: webapp_main

# 需要导入模块: from google.appengine.ext.webapp import util [as 别名]
# 或者: from google.appengine.ext.webapp.util import run_wsgi_app [as 别名]
def webapp_main():
    """Run within webapp framework.
    """
    # Ofcourse, instead allowing solely Google Accounts and using the integrated
    # system, this recipe could be extended to also login other accounts.
    # However, there the automatic Cookie checking would obviously fail and you
    # would need to do ones own checking. Possibly by using a session instead of
    # cookies, by using other cookies, or by simply having each HTTP request
    # Authorized; unlike this recipe. This is two-legged authentication, so the 
    # latter would not be advised (doing (re)authentication for repeated requests). 
    #from gaesessions import SessionMiddleware
    #run_wsgi_app(SessionMiddleware(application))

    run_wsgi_app(application) 
开发者ID:ActiveState,项目名称:code,代码行数:16,代码来源:recipe-577235.py


注:本文中的google.appengine.ext.webapp.util.run_wsgi_app方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。