diff --git a/panel/io/jupyter_executor.py b/panel/io/jupyter_executor.py index eb847123c7..d8c9758f3e 100644 --- a/panel/io/jupyter_executor.py +++ b/panel/io/jupyter_executor.py @@ -73,7 +73,7 @@ class PanelExecutor(WSHandler): _tasks = set() - def __init__(self, path, token, root_url): + def __init__(self, path, token, root_url, resources='server'): self.path = path self.token = token self.root_url = root_url @@ -87,8 +87,10 @@ def __init__(self, path, token, root_url): self.write_lock = tornado.locks.Lock() self._context = None + resources = os.environ.get('BOKEH_RESOURCES', resources) + root_url = self.root_url if resources == 'server' else None self.resources = Resources( - mode=os.environ.get('BOKEH_RESOURCES', 'server'), root_url=self.root_url, + mode=resources, root_url=root_url, path_versioner=StaticHandler.append_version, absolute=True ) self._set_state() diff --git a/panel/io/jupyter_server_extension.py b/panel/io/jupyter_server_extension.py index 3e72a9aa9d..6d1d01dc35 100644 --- a/panel/io/jupyter_server_extension.py +++ b/panel/io/jupyter_server_extension.py @@ -112,7 +112,6 @@ def get_server_root_dir(settings): import pathlib import sys -os.environ['BOKEH_RESOURCES'] = 'server' app = r'{{ path }}' os.chdir(str(pathlib.Path(app).parent)) sys.path = [os.getcwd()] + sys.path[1:]