Django channels Group send stop working

215 views
Skip to first unread message

Shubham Aggarwal

unread,
Jul 19, 2017, 12:36:45 PM7/19/17
to Django developers (Contributions to Django itself)
I am working on ordering system and using django-channels for sending a notification to an admin about the order has been placed and it works only with 1-2 orders perfectly after that no notification. 


# consumers.py
 
from channels import Group
 
from channels.sessions import channel_session
 


 
@channel_session
 
def ws_connect(message):
   
print "Connect"
    message
.reply_channel.send({"accept": True})
   
Group('admin-channel', channel_layer=message.channel_layer).add(message.reply_channel)
 


 
@channel_session
 
def ws_disconnect(message):
   
print "Disconnect"
   
Group('admin-channel', channel_layer=message.channel_layer).discard(message.reply_channel)


# views.py
 
def view(request):
       
# some order realted processing
    message
= {
       
"status": "Success",
       
"order-id": order.id
   
}


   
Group('admin-channel').send({
       
"text": json.dumps(message)
   
})


it stop sending message after 1-2 orders .

Artem Malyshev

unread,
Jul 19, 2017, 12:42:24 PM7/19/17
to Django developers (Contributions to Django itself)
I need python process stdout with debug enabled.
Reply all
Reply to author
Forward
0 new messages