File tree Expand file tree Collapse file tree 4 files changed +24
-5
lines changed
examples/django_embed/django_embed Expand file tree Collapse file tree 4 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,17 @@ This documentation assumes that you have already started a [Django project](http
7070 If the Bokeh `` resources`` setting is set to `` server`` then we must add the location of the Bokeh resources to the `` STATICFILES_DIRS `` setting:
7171
7272 ```python
73- from bokeh.settings import settings as bokeh_settings, bokehjsdir
73+ from bokeh.settings import settings as bokeh_settings
74+
75+ try :
76+ bokeh_js_dir = bokeh_settings.bokehjs_path()
77+ except AttributeError :
78+ # support bokeh versions < 3.4
79+ bokeh_js_dir = bokeh_settings.bokehjsdir()
7480
7581 STATICFILES_DIRS = [
7682 ... ,
77- bokehjsdir() ,
83+ bokeh_js_dir ,
7884 ]
7985 ```
8086
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ class ConsumerHelper(AsyncConsumer):
7979 def request (self ) -> "AttrDict" :
8080 request = AttrDict (self .scope )
8181 request ["arguments" ] = self .arguments
82+
83+ # patch for panel 1.4
84+ request ['protocol' ] = request .get ('scheme' )
85+ for k , v in request .headers :
86+ request [k .decode ()] = v .decode ()
87+ request ['uri' ] = request .get ('path' )
88+
8289 return request
8390
8491 @property
Original file line number Diff line number Diff line change 1212
1313from pathlib import Path
1414
15- from bokeh .settings import bokehjsdir , settings as bokeh_settings
15+ from bokeh .settings import settings as bokeh_settings
16+
17+ try :
18+ bokeh_js_dir = bokeh_settings .bokehjs_path ()
19+ except AttributeError :
20+ # support bokeh versions < 3.4
21+ bokeh_js_dir = bokeh_settings .bokehjsdir ()
1622
1723# Build paths inside the project like this: BASE_DIR / 'subdir'.
1824MODULE_DIR = Path (__file__ ).resolve ().parent
127133
128134DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
129135
130- STATICFILES_DIRS = [bokehjsdir () ]
136+ STATICFILES_DIRS = [bokeh_js_dir ]
131137
132138STATICFILES_FINDERS = (
133139 "django.contrib.staticfiles.finders.FileSystemFinder" ,
Original file line number Diff line number Diff line change 4646 autoload ("sea-surface-temp" , views .sea_surface_handler ),
4747 autoload ("sea_surface_custom_uri" , views .sea_surface_handler ),
4848 autoload ("shapes" , views .shape_viewer_handler ),
49- autoload ("shapes/(?P<arg1>[\w_\-]+)/(?P<arg2>[\w_\-]+)" , views .shape_viewer_handler_with_args ),
49+ autoload (r "shapes/(?P<arg1>[\w_\-]+)/(?P<arg2>[\w_\-]+)" , views .shape_viewer_handler_with_args ),
5050]
You can’t perform that action at this time.
0 commit comments