views.py 文件源码

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

项目:pyramid_notebook 作者: websauna 项目源码 文件源码
def notebook_proxy(request, username):
    """Renders a IPython Notebook frame wrapper.

    Starts or reattachs ot an existing Notebook session.
    """
    security_check(request, username)

    manager = get_notebook_manager(request)
    notebook_info = manager.get_context(username)

    if not notebook_info:
        raise HTTPInternalServerError("Apparently IPython Notebook daemon process is not running for {}".format(username))

    if not "http_port" in notebook_info:
        raise RuntimeError("Notebook terminated prematurely before managed to tell us its HTTP port")

    return proxy_it(request, notebook_info["http_port"])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号