You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -191,7 +191,7 @@ urlpatterns = [
191
191
]
192
192
```
193
193
194
-
Next, use `DEFAULT_RENDERER_CLASSES` in `settings.py` to manage the renderers you want to use. The `django_eventstream.renderers.SSEEventRenderer` is required to enable SSE functionality. If you also want the Browsable API view, add `django_eventstream.renderers.BrowsableAPIEventStreamRenderer`.
194
+
Next, use `DEFAULT_RENDERER_CLASSES` in `settings.py` to manage the renderers you want to use. The `django_eventstream.renderers.SSEEventRenderer` is required to enable SSE functionality. If you also want the Browsable API view, add `django_eventstream.renderers.BrowsableAPIEventStreamRenderer`. By default they are define in the EventsViewSet class.
Copy file name to clipboardExpand all lines: django_eventstream/viewsets.py
+50-35Lines changed: 50 additions & 35 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,4 @@
1
+
importlogging
1
2
fromdjango.confimportsettings
2
3
fromrest_framework.viewsetsimportViewSet
3
4
fromrest_framework.responseimportResponse
@@ -10,6 +11,7 @@
10
11
BrowsableAPIEventStreamRenderer,
11
12
)
12
13
14
+
logger=logging.getLogger(__name__)
13
15
14
16
classEventsViewSet(ViewSet):
15
17
"""
@@ -22,50 +24,64 @@ class EventsViewSet(ViewSet):
22
24
- By setting the channel in the URL.
23
25
Those three ways are mutually exclusive, so you can only use one of them.
24
26
25
-
If you want to see a specific type of messages and not the default "message" type, you can set the messages_types attribute in the class definition.
26
-
That's the only way provided to set the messages types.
27
+
If you want to see a specific type of messages and not the default "message" type, you can set the messages_types attribute in the class definition or by using the configure_events_view_set method.
28
+
That's the only ways provided to set the messages types.
0 commit comments