views.py 文件源码

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

项目:pyramid_notebook 作者: websauna 项目源码 文件源码
def shell1(request):

    # Make sure we have a logged in user
    auth = request.registry.queryUtility(IAuthenticationPolicy)
    username = auth.authenticated_userid(request)

    if not username:
        # This will trigger HTTP Basic Auth dialog, as per basic_challenge handler below
        raise httpexceptions.HTTPForbidden("You need to be logged in. Hint: user / password")

    notebook_context = {"greeting": "**Executing shell1 context**\n"}
    config_file = request.registry.settings["global_config"]["__file__"]
    startup.make_startup(notebook_context, config_file)

    return launch_notebook(request, username, notebook_context=notebook_context)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号