當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。