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)
评论列表
文章目录