Hi,
I trying to run a Panel application served with Django.
I am able to run the Panel application but no templates or css files seems to be used.
When I for example try to put my widgets into bootstrap template (pn.template.BootstrapTemplate), no template graphics are shown and I only see widgets added to main body.
Similar problem is when I try to include Tabulator I get a error message Not Found: /page_address/static/extensions/panel/bundled/datatabulator/tabulator-tables@4.9.3/dist/css/tabulator_simple.min.css and the css file loaded from internet instead.
I can see that all files are collected into static folder.
Any help would be greatly appreciated.
T.
I think I found out what the problem was.
In bokeh/server/django/static.py I had to change line 48 to
name, artifact_path = path.split('/', 1) #change from os.sep to '/'
and regex pattern to
return [re_path(r'^.*%s(?P<path>.*)$' % re.escape(prefix.lstrip('/')), serve_extensions )]
Also I noticed that when using tabulator widget it is necessary to specify theme already in constructor. When I tried to set a them after the widget was already created, I wasn’t able to load css files properly.
1 Like