Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix local bundled paths for template resources #1891

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion panel/template/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,9 @@ def _init_doc(self, doc=None, comm=None, title=None, notebook=False, location=Tr
def _template_resources(self):
name = type(self).__name__.lower()
resources = _settings.resources(default="server")
base_url = state.base_url[1:] if state.base_url.startswith('/') else state.base_url
if resources == 'server':
dist_path = urljoin(state.base_url, LOCAL_DIST)
dist_path = urljoin(base_url, LOCAL_DIST)
else:
dist_path = CDN_DIST

Expand Down
2 changes: 1 addition & 1 deletion panel/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def bundled_files(model, file_type='javascript'):
filepath = url_path(url)
test_filepath = filepath.split('?')[0]
if resources == 'server' and os.path.isfile(os.path.join(bdir, test_filepath)):
files.append(f'/static/extensions/panel/bundled/{name}/{filepath}')
files.append(f'static/extensions/panel/bundled/{name}/{filepath}')
else:
files.append(url)
return files
Expand Down