当前位置: 首页>>代码示例>>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;未经允许,请勿转载。