Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

check django channels with redis setup

import channels.layers
channel_layer = channels.layers.get_channel_layer()
from asgiref.sync import async_to_sync
async_to_sync(channel_layer.send)('test_channel', {'type': 'hello'})
async_to_sync(channel_layer.receive)('test_channel')
Source by channels.readthedocs.io #
 
PREVIOUS NEXT
Tagged: #check #django #channels #redis #setup
ADD COMMENT
Topic
Name
6+1 =