File tree 4 files changed +24
-5
lines changed
examples/django_embed/django_embed
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
70
70
If the Bokeh `` resources`` setting is set to `` server`` then we must add the location of the Bokeh resources to the `` STATICFILES_DIRS `` setting:
71
71
72
72
```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()
74
80
75
81
STATICFILES_DIRS = [
76
82
... ,
77
- bokehjsdir() ,
83
+ bokeh_js_dir ,
78
84
]
79
85
```
80
86
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ class ConsumerHelper(AsyncConsumer):
79
79
def request (self ) -> "AttrDict" :
80
80
request = AttrDict (self .scope )
81
81
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
+
82
89
return request
83
90
84
91
@property
Original file line number Diff line number Diff line change 12
12
13
13
from pathlib import Path
14
14
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 ()
16
22
17
23
# Build paths inside the project like this: BASE_DIR / 'subdir'.
18
24
MODULE_DIR = Path (__file__ ).resolve ().parent
127
133
128
134
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
129
135
130
- STATICFILES_DIRS = [bokehjsdir () ]
136
+ STATICFILES_DIRS = [bokeh_js_dir ]
131
137
132
138
STATICFILES_FINDERS = (
133
139
"django.contrib.staticfiles.finders.FileSystemFinder" ,
Original file line number Diff line number Diff line change 46
46
autoload ("sea-surface-temp" , views .sea_surface_handler ),
47
47
autoload ("sea_surface_custom_uri" , views .sea_surface_handler ),
48
48
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 ),
50
50
]
You can’t perform that action at this time.
0 commit comments