def save_chat_message(*args, **kwargs):
    """
    kwargs will always include:

     'data': 
        # will always be exactly what your client sent on the socket
        # in this case...
        {u'message': u'hi', u'sender': u'anonymous', u'channel': u'homepage'},

     'dispatcher': 
        # the dispatcher that will allow for broadcasting a response
      <hendrix.contrib.concurrency.messaging.MessageDispatcher object at 0x10ddb1c10>,

    """

    data = kwargs.get('data')
    if data.get('message') and data.get('channel'):
        cm = ChatMessage.objects.create(
            sender=data.get('sender'),
            content=data.get('message'),
            channel=data.get('channel')
        )

        t = loader.get_template('message.html')

        # now send broadcast a message back to anyone listening on the channel
        hey_joe.send({'html': t.render({'message': cm})}, cm.channel)
kwargs will always include:

     'data': 
        # will always be exactly what your client sent on the socket
        # in this case...
        {u'message': u'hi', u'sender': u'anonymous', u'channel': u'homepage'},

     'dispatcher': 
        # the dispatcher that will allow for broadcasting a response
      <hendrix.contrib.concurrency.messaging.MessageDispatcher object at 0x10ddb1c10>,