File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change
1
+ from channels import __version__ as channels_version
1
2
from channels .routing import ProtocolTypeRouter , URLRouter
2
3
from channels .sessions import SessionMiddlewareStack
4
+ from django .utils .version import get_version_tuple
3
5
from django .apps import apps
4
6
from django .urls import path
5
7
from .consumers import GraphQLSubscriptionConsumer
10
12
AuthMiddlewareStack = None
11
13
12
14
13
- websocket_urlpatterns = [path ("subscriptions" , GraphQLSubscriptionConsumer )]
15
+ channels_version_tuple = get_version_tuple (channels_version )
16
+
17
+
18
+ if channels_version_tuple > (3 , 0 , 0 ):
19
+ websocket_urlpatterns = [path ("subscriptions" , GraphQLSubscriptionConsumer .as_asgi ())]
20
+ else :
21
+ websocket_urlpatterns = [path ("subscriptions" , GraphQLSubscriptionConsumer )]
14
22
15
23
application = ProtocolTypeRouter ({"websocket" : URLRouter (websocket_urlpatterns )})
16
24
Original file line number Diff line number Diff line change 57
57
channels ==1.*; python_version<"3"
58
58
django ==2.*; python_version>="3"
59
59
channels ==2.*; python_version>="3"
60
+ django ==3.*; python_version>="3"
61
+ channels ==3.*; python_version>="3"
60
62
aiohttp; python_version>="3.5"
61
63
62
64
[bdist_wheel]
You can’t perform that action at this time.
0 commit comments