當前位置: 首頁>>代碼示例>>Python>>正文


Python basehttp.get_internal_wsgi_application方法代碼示例

本文整理匯總了Python中django.core.servers.basehttp.get_internal_wsgi_application方法的典型用法代碼示例。如果您正苦於以下問題:Python basehttp.get_internal_wsgi_application方法的具體用法?Python basehttp.get_internal_wsgi_application怎麽用?Python basehttp.get_internal_wsgi_application使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在django.core.servers.basehttp的用法示例。


在下文中一共展示了basehttp.get_internal_wsgi_application方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_default

# 需要導入模塊: from django.core.servers import basehttp [as 別名]
# 或者: from django.core.servers.basehttp import get_internal_wsgi_application [as 別名]
def test_default(self):
        """
        If ``WSGI_APPLICATION`` is ``None``, the return value of
        ``get_wsgi_application`` is returned.
        """
        # Mock out get_wsgi_application so we know its return value is used
        fake_app = object()

        def mock_get_wsgi_app():
            return fake_app
        from django.core.servers import basehttp
        _orig_get_wsgi_app = basehttp.get_wsgi_application
        basehttp.get_wsgi_application = mock_get_wsgi_app

        try:
            app = get_internal_wsgi_application()

            self.assertIs(app, fake_app)
        finally:
            basehttp.get_wsgi_application = _orig_get_wsgi_app 
開發者ID:nesdis,項目名稱:djongo,代碼行數:22,代碼來源:tests.py

示例2: handle

# 需要導入模塊: from django.core.servers import basehttp [as 別名]
# 或者: from django.core.servers.basehttp import get_internal_wsgi_application [as 別名]
def handle(self, *args, **options):
        m = re.match(naiveip_re, options['addrport'])
        if m is None:
            raise CommandError('"%s" is not a valid port number '
                               'or address:port pair.' % options['addrport'])
        addr, _ipv4, _ipv6, _fqdn, port = m.groups()
        if not port.isdigit():
            raise CommandError("%r is not a valid port number." % port)

        if addr:
            if _ipv6:
                raise CommandError('IPv6 addresses are currently not supported.')


        application = get_internal_wsgi_application()
        server = Server(application)

        for file in os.listdir('.'):
            if file[0] != '.' and file[:2] != '__' and os.path.isdir(file):
                server.watch(file)

        server.serve(host=addr, port=port, liveport=options['liveport']) 
開發者ID:V1EngineeringInc,項目名稱:V1EngineeringInc-Docs,代碼行數:24,代碼來源:livereload.py

示例3: make_wsgi_application

# 需要導入模塊: from django.core.servers import basehttp [as 別名]
# 或者: from django.core.servers.basehttp import get_internal_wsgi_application [as 別名]
def make_wsgi_application():
    # validate models
    s = StringIO()
    if get_validation_errors(s):
        s.seek(0)
        error = s.read()
        msg = "One or more models did not validate:\n%s" % error
        print(msg, file=sys.stderr)
        sys.stderr.flush()
        sys.exit(1)

    translation.activate(settings.LANGUAGE_CODE)
    if django14:
        return get_internal_wsgi_application()
    return WSGIHandler() 
開發者ID:jpush,項目名稱:jbox,代碼行數:17,代碼來源:django_wsgi.py

示例4: get_handler

# 需要導入模塊: from django.core.servers import basehttp [as 別名]
# 或者: from django.core.servers.basehttp import get_internal_wsgi_application [as 別名]
def get_handler(self, *args, **options):
        """
        Returns the default WSGI handler for the runner.
        """
        return get_internal_wsgi_application() 
開發者ID:lanbing510,項目名稱:GTDWeb,代碼行數:7,代碼來源:runserver.py

示例5: test_success

# 需要導入模塊: from django.core.servers import basehttp [as 別名]
# 或者: from django.core.servers.basehttp import get_internal_wsgi_application [as 別名]
def test_success(self):
        """
        If ``WSGI_APPLICATION`` is a dotted path, the referenced object is
        returned.
        """
        app = get_internal_wsgi_application()

        from .wsgi import application

        self.assertIs(app, application) 
開發者ID:nesdis,項目名稱:djongo,代碼行數:12,代碼來源:tests.py

示例6: test_bad_module

# 需要導入模塊: from django.core.servers import basehttp [as 別名]
# 或者: from django.core.servers.basehttp import get_internal_wsgi_application [as 別名]
def test_bad_module(self):
        msg = "WSGI application 'wsgi.noexist.app' could not be loaded; Error importing"
        with self.assertRaisesMessage(ImproperlyConfigured, msg):
            get_internal_wsgi_application() 
開發者ID:nesdis,項目名稱:djongo,代碼行數:6,代碼來源:tests.py

示例7: test_bad_name

# 需要導入模塊: from django.core.servers import basehttp [as 別名]
# 或者: from django.core.servers.basehttp import get_internal_wsgi_application [as 別名]
def test_bad_name(self):
        msg = "WSGI application 'wsgi.wsgi.noexist' could not be loaded; Error importing"
        with self.assertRaisesMessage(ImproperlyConfigured, msg):
            get_internal_wsgi_application() 
開發者ID:nesdis,項目名稱:djongo,代碼行數:6,代碼來源:tests.py


注:本文中的django.core.servers.basehttp.get_internal_wsgi_application方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。