__init__.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:edwiges 作者: loggi 项目源码 文件源码
def main(global_config, **settings):

    print
    for name in ENV_SETTINGS:
        settings[name] = get_config_environ(name) or settings.get(name)

    for name in REQUIRED_SETTINGS:
        if settings.get(name) is None:
            error = 'confiration entry for {} is missing'.format(name)
            logger.critical(error)
            raise ConfigurationError(error)

    config = Configurator(settings=settings)
    config.include("cornice")
    config.scan("edwiges.views")

    host = settings['edwiges.provider_host']
    port = settings['edwiges.provider_port']

    logger.info("Starting server", extra={'host': host, 'port': port})
    return config.make_wsgi_app()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号